Sha256: f4a1ff57534d963f981215125b97cc184bdc4039e5bf8465df749e237866f8b4

Contents?: true

Size: 318 Bytes

Versions: 2

Compression:

Stored size: 318 Bytes

Contents

class Role
  include Mongoid::Document
  
  has_and_belongs_to_many :users
  belongs_to :resource, :polymorphic => true
  
  field :name, :type => String
  index({ :name => 1 }, { :unique => true })


  index({
    :name => 1,
    :resource_type => 1,
    :resource_id => 1
  },
  { :unique => true})
  
  scopify
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
mix-rails-0.22.0 mix-rails-auth/app/models/role.rb
mix-rails-auth-0.22.0 app/models/role.rb