Commit 578db70
committed
fix(cli): keep generate controller no-actions path from writing an index view
Review finding on #3131: the unconditional `actions = result.actions` in
Module.cfc adopted CodeGen's defaulted ["index"] list when the user passed no
actions, so `wheels generate controller Users` started writing
app/views/users/index.cfm — contradicting the documented "passing no actions
creates an empty controller with no view files" behavior retained in the same
code-generation.mdx paragraph.
Surface the caller-requested (post-normalization, pre-default) action list as
result.actions instead: empty input stays empty, so the view loop writes
nothing, while comma-joined tokens still expand to one view per real action.
The controller body keeps its default index() stub as before. Covered by a new
CodeGenSpec case asserting result.actions is empty (and the stub present) for
the no-actions path.
Signed-off-by: Peter Amiri <peter@alurium.com>1 parent d967a9c commit 578db70
3 files changed
Lines changed: 32 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3190 | 3190 | | |
3191 | 3191 | | |
3192 | 3192 | | |
3193 | | - | |
3194 | | - | |
3195 | | - | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
3196 | 3198 | | |
3197 | 3199 | | |
3198 | 3200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
253 | 268 | | |
254 | 269 | | |
255 | 270 | | |
| |||
0 commit comments