1
0
Fork 0
dokkan-data-rails/app/models/role.rb

11 lines
274 B
Ruby
Raw Normal View History

2015-10-08 15:18:21 -04:00
class Role < ActiveRecord::Base
has_and_belongs_to_many :users, :join_table => :users_roles
belongs_to :resource, :polymorphic => true
validates :resource_type,
:inclusion => { :in => Rolify.resource_types },
:allow_nil => true
scopify
end