Sha256: f04c2f7bb40217d27c9d15cec7b247ffdd1d8ed4521d4849246516267553db90

Contents?: true

Size: 555 Bytes

Versions: 7

Compression:

Stored size: 555 Bytes

Contents

module Wobauth
  class Role < ActiveRecord::Base
    # -- associations
    has_many :authorities
    has_many :users,  through:     :authorities,
                      source:      :authorizable,
                      source_type: Wobauth::User
    has_many :groups, through:     :authorities,
                      source:      :authorizable,
                      source_type: Wobauth::Group
    # -- configuration
    # -- validations and callbacks
    validates :name, :presence => true, :uniqueness => true

    def to_s
      name
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wobauth-5.0.0 app/models/wobauth/role.rb
wobauth-4.0.0 app/models/wobauth/role.rb
wobauth-3.4.8 app/models/wobauth/role.rb
wobauth-3.4.7 app/models/wobauth/role.rb
wobauth-3.4.6 app/models/wobauth/role.rb
wobauth-3.4.5 app/models/wobauth/role.rb
wobauth-3.4.4 app/models/wobauth/role.rb