avo-setup 0.0.19 → 0.0.20

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.
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.20"
3
3
  end
@@ -18,6 +18,8 @@ module Avo
18
18
  if yes?("Would you like to use CanCan")
19
19
  gem("cancan")
20
20
  copy_file "ability.rb", "models/ability.rb"
21
+ @single=model_name
22
+ @plural=model_name.pluralize
21
23
  migration_template 'create_roles_migration.rb', "db/migrate/create_roles.rb"
22
24
  end
23
25
  end
@@ -4,8 +4,8 @@ class CreateRolesMigration < ActiveRecord::Migration
4
4
  t.string :title
5
5
  t.timestamps
6
6
  end
7
- create_table :roles_users, :force => true do |t|
8
- t.integer :user_id
7
+ create_table :roles_<%= @plural %>, :force => true do |t|
8
+ t.integer :<%= @single %>_id
9
9
  t.integer :role_id
10
10
  t.timestamps
11
11
  end
@@ -13,7 +13,7 @@ class CreateRolesMigration < ActiveRecord::Migration
13
13
  end
14
14
 
15
15
  def self.down
16
- drop_table :roles_users
16
+ drop_table :roles_<%= @plural %>
17
17
  drop_table :roles
18
18
  end
19
19
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 19
9
- version: 0.0.19
8
+ - 20
9
+ version: 0.0.20
10
10
  platform: ruby
11
11
  authors:
12
12
  - Avocado