Sha256: 43821b4f4aaeac88360f76fdf7d34b78d3334526ef2bc6f17ac08fac15618bba

Contents?: true

Size: 567 Bytes

Versions: 8

Compression:

Stored size: 567 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: {case_sensitive: true}

    def to_s
      name
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wobauth-6.0.1 app/models/wobauth/role.rb
wobauth-6.0.0 app/models/wobauth/role.rb
wobauth-5.1.3 app/models/wobauth/role.rb
wobauth-5.1.2 app/models/wobauth/role.rb
wobauth-5.1.1 app/models/wobauth/role.rb
wobauth-5.1.0 app/models/wobauth/role.rb
wobauth-5.0.2 app/models/wobauth/role.rb
wobauth-5.0.1 app/models/wobauth/role.rb