Skip to content

Instantly share code, notes, and snippets.

@mt9304

mt9304/role.rb Secret

Created October 8, 2018 18:54
Embed
What would you like to do?
class Role < ApplicationRecord
has_and_belongs_to_many :users, :join_table => :users_roles
belongs_to :resource,
:polymorphic => true,
optional: true
validates :resource_type,
:inclusion => { :in => Rolify.resource_types },
:allow_nil => true
scopify
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment