Users model migration
If your user and features model can have a many-to-many relationship, then you can use the following example:


  A has_and_belongs_to_many association creates a direct many-to-many
  connection with another model, with no intervening model


class CreateUsersAndStatusFeatures &lt; ActiveRecord::Migration
  def change
    create_table :status_features do |t|
      t.string :name
      t.timestamps null: false
    end
    # Do not create users table if you already have.
    create_table :users do |t|
      t.string :name
      t.timestamps null: false
    end
    create_table :users_status_features, id: false do |t|
      t.belongs_to :user, index: true
      t.belongs_to :status_feature, index: true
    end
  end
end

class User &lt; ActiveRecord::Base
  has_and_belongs_to_many :status_features
end
class StatusFeature &lt; ActiveRecord::Base
  has_and_belongs_to_many :users
end


If you want to know in detail, go to this link.