Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 528 Bytes

Alternative Multi Roles setup

  class UsersHaveAndBelongToManyRoles < ActiveRecord::Migration
    def self.up
      create_table :roles_users, :id => false do |t|
        t.references :role, :user
      end
    end

    def self.down
      drop_table :roles_users
    end
  end  

And your models look like this:

  # User Model
  class User < ActiveRecord::Base
    has_and_belongs_to_many :roles
  ....
  # Role model
  class Role < ActiveRecord::Base
    has_and_belongs_to_many :users
  end