Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed the file naming to generate a "roles_user.rb" model

instead of "role_user.rb"

Signed-off-by: Glenn Rempe <glenn@rempe.us>
  • Loading branch information...
commit 3d421fb6c4ada284d8a737df9d53acc9002c8f88 1 parent 7805f0e
Lennart Melzer authored grempe committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  generators/role_model/role_model_generator.rb
View
2  generators/role_model/role_model_generator.rb
@@ -14,7 +14,7 @@ def manifest
# Model class, unit test, and fixtures.
m.template 'role_model.rb', File.join('app/models', class_path, "#{file_name}.rb")
- m.template 'role_user_model.rb', File.join('app/models', class_path, "#{(file_name < 'user') ? "#{file_name}_user" : "user_#{file_name}"}.rb")
+ m.template 'role_user_model.rb', File.join('app/models', class_path, "#{(file_name.pluralize < 'user') ? "#{file_name}_user" : "user_#{file_name}"}.rb")
m.template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
m.template 'fixtures.yml', File.join('test/fixtures', class_path, "#{table_name}.yml")
Please sign in to comment.
Something went wrong with that request. Please try again.