You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to this commit, Authentication generator calls to
[Thor::Actions#template][] were passing a second optional argument to
specify the full filename of the destination.
This was necessary because the template files were nested within
`lib/rails/generators/rails/authentication/templates` in a way that did
not reflect their final destinations. For example, the `user.rb` file
was declared in
`lib/rails/generators/rails/authentication/templates/models/user.rb`
instead of
`lib/rails/generators/rails/authentication/templates/app/models/user.rb`
(i.e. `templates/models/user.rb` instead of
`templates/app/models/user.rb`).
This commit nests the files within the `template/` directory under
`app/` when appropriate, which makes the second argument to
`Thor::Actions#template` optional and able to be omitted.
In addition to the file structure changes, this commit utilizes the
[Thor::Actions#inject_into_class][] helper instead of a call to
[Thor::Actions#gsub_file][].
[Thor::Actions#template]: https://www.rubydoc.info/gems/thor/Thor/Actions#template-instance_method
[Thor::Actions#inject_into_class]: https://www.rubydoc.info/gems/thor/Thor%2FActions:inject_into_class
[Thor::Actions#gsub_file]: https://www.rubydoc.info/gems/thor/Thor%2FActions:gsub_file
0 commit comments