In 0.14.1 the use of
script/generate scaffold <model_name> <controller_name>
would generate a controller with the default <model_name>Controller instead of <controller_name>Controller.
This is because of a change between 0.13.1 and 0.14.1 scaffold_generator.rb
- @controller_name = args.shift
@name.pluralize
+ @controller_name = args.shift | ActiveRecord::Base.pluralize_table_names ? @name.pluralize : @name
However ?: has a higher precedence than | so that @controller_name ends up getting the wrong value. The patch fixes this by putting the RHS in () where it belongs.
@controller_name = args.shift ( ActiveRecord::Base.pluralize_table_names ? @name.pluralize : @name )
With thanks to chris2 and DireRed for their help in sorting it out.
Attachments
Change History
Download in other formats:
| |