Sha256: 30d3a394df00572a514a5ed1a370154aaff9fbaf07333419ae8ac5ff0e491f00

Contents?: true

Size: 319 Bytes

Versions: 5

Compression:

Stored size: 319 Bytes

Contents

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
date_book-0.0.6 spec/dummy/app/models/role.rb
date_book-0.0.5 spec/dummy/app/models/role.rb
date_book-0.0.3 spec/dummy/app/models/role.rb
date_book-0.0.2 spec/dummy/app/models/role.rb
date_book-0.0.1 spec/dummy/app/models/role.rb