Defect #28668

Updated by Go MAEDA over 1 year ago

redmine_plugin_controller generates not snake case file name but camel case file name when specifying controller name as camel case.

For example:
$ bundle exec rails generate redmine_plugin_controller redmine_plugin_contro
hello_message FooBars
create plugins/hello_message/app/controllers/FooBars_controller.rb
create plugins/hello_message/app/helpers/FooBars_helper.rb
create plugins/hello_message/test/functional/FooBars_controller_test.rb

This causes

On the other hand, redmine_plugin_model generates snake case file name when specifying model name as camel case.

$ bundle exec rails generate redmine_plugin_model
hello_message FooBar
create plugins/hello_message/app/models/foo_bar.rb
create plugins/hello_message/test/unit/foo_bar_test.rb
create plugins/hello_message/db/migrate/004_create_foo_bars.rb

Ruby on Rails' @rails generate controller FooBars@ command generates snake case file name: 'foo_bars_controller.rb', too.

Environment is as follows
Redmine version 3.4.5.stable.17297
Ruby version 2.4.3-p205 (2017-12-14) [x86_64-linux]
Rails version 4.2.8
Environment production
Database adapter SQLite

* trunk has same behavior.

I expect to generate controller file with snake case name even if controller name is specified by camel case, like model file name.