avo-setup 0.0.23 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/avo-setup/version.rb +1 -1
- data/lib/generators/avo/setup_generator.rb +4 -2
- metadata +2 -2
data/lib/avo-setup/version.rb
CHANGED
@@ -21,9 +21,11 @@ module Avo
|
|
21
21
|
gem("cancan")
|
22
22
|
copy_file "ability.rb", "models/ability.rb"
|
23
23
|
@single=model_name
|
24
|
+
inject_into_class "app/models/"+@single.underscore+".rb", "has_and_belongs_to_many :roles\n"
|
24
25
|
@plural=model_name.pluralize
|
25
|
-
|
26
|
-
@migname
|
26
|
+
template "role.rb", "app/models/role.rb"
|
27
|
+
@migname=@plural+"_roles" if (@plural.casecmp "roles")<0
|
28
|
+
@migname="roles_"+@plural if (@plural.casecmp "roles")>=0
|
27
29
|
|
28
30
|
migration_template 'create_roles_migration.rb', "db/migrate/create_roles.rb"
|
29
31
|
end
|