Sha256: e686e4708d89c5e58e72e4f1acb8f69890e7def4ea285b1f6aa36976df4c5dc6

Contents?: true

Size: 446 Bytes

Versions: 7

Compression:

Stored size: 446 Bytes

Contents

module Wobauth
  class Group < ActiveRecord::Base
    # -- associations
    has_many :authorities, as: :authorizable
    has_many :roles,       through: :authorities
    has_many :memberships
    has_many :users, -> { uniq }, through: :memberships,
                     source: :user
    # -- 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/group.rb
wobauth-4.0.0 app/models/wobauth/group.rb
wobauth-3.4.8 app/models/wobauth/group.rb
wobauth-3.4.7 app/models/wobauth/group.rb
wobauth-3.4.6 app/models/wobauth/group.rb
wobauth-3.4.5 app/models/wobauth/group.rb
wobauth-3.4.4 app/models/wobauth/group.rb