/ Published in: Rails
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# acts_as_roleable create_table :users, :force => true do |t| t.string :name # ... end # acts_as_roleable create_table :groups, :force => true do |t| t.string :name # ... end create_table :memberships, :force => true do |t| t.integer :group_id t.integer :user_id end create_table :roles, :force => true do |t| t.string :name t.column :roleable_id, :integer t.column :roleable_type, :string end create_table :permissions, :force => true do |t| t.string :role_id t.string :name # ... end
URL: removing-the-join-table-in-rails