avo-setup 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/avo-setup/version.rb +1 -1
- data/lib/generators/avo/setup_generator.rb +14 -10
- metadata +2 -2
data/lib/avo-setup/version.rb
CHANGED
@@ -8,22 +8,26 @@ module Avo
|
|
8
8
|
if yes?("Would you like to generate a layout?")
|
9
9
|
generate("avo:layout")
|
10
10
|
end
|
11
|
+
#Devise
|
11
12
|
if yes?("Would you like to install Devise?")
|
12
13
|
gem("devise")
|
13
14
|
generate("devise:install")
|
14
15
|
model_name = ask("What would you like the user model to be called? [user]")
|
15
16
|
model_name = "user" if model_name.blank?
|
16
17
|
generate("devise", model_name)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
|
19
|
+
#CanCan
|
20
|
+
if yes?("Would you like to use CanCan?")
|
21
|
+
gem("cancan")
|
22
|
+
copy_file "ability.rb", "models/ability.rb"
|
23
|
+
@single=model_name
|
24
|
+
@plural=model_name.pluralize
|
25
|
+
@migname=@plural+"_roles" if (@plural.casecmp "roles")>=0
|
26
|
+
@migname="roles_"+@plural if (@plural.casecmp "roles")<0
|
27
|
+
|
28
|
+
migration_template 'create_roles_migration.rb', "db/migrate/create_roles.rb"
|
29
|
+
end
|
30
|
+
|
27
31
|
end
|
28
32
|
end
|
29
33
|
|