Permalink
Browse files

Added missing habtm_name definition.

  • Loading branch information...
1 parent f632a24 commit 2a28d1500d69a1b82dc2df0697975af3dbdbc7e3 “grin” committed with Apr 29, 2009
Showing with 3 additions and 2 deletions.
  1. +1 −1 generators/role_generator_helpers.rb
  2. +2 −1 generators/roles/roles_generator.rb
@@ -85,4 +85,4 @@ def users_model_filename; "app/models/#{users_model_name.underscore}.rb"; end;
def users_name; "#{users_model_name.downcase}"; end;
-end
+end
@@ -108,6 +108,7 @@ def render_template(name)
ERB.new(template, nil, "-").result(binding)
end
+ def habtm_name; [roles_table_name, users_table_name].sort * "_"; end
def roles_foreign_key; roles_table_name.singularize.foreign_key; end
def roles_model_filename; "app/models/#{roles_model_name.underscore}.rb"; end;
def users_foreign_key; users_table_name.singularize.foreign_key; end
@@ -117,4 +118,4 @@ def banner
"Usage: #{$0} roles RoleModelName [TargetUserModelName]"
end
-end
+end

0 comments on commit 2a28d15

Please sign in to comment.