Sha256: 49c9d009351886955348137b5efffe1e171adaf5e078a04654d0e43156d5414f

Contents?: true

Size: 433 Bytes

Versions: 16

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true

module G5Authenticatable
  # A user role (e.g. admin, viewer), optionally scoped to a client or location
  class Role < ActiveRecord::Base
    has_and_belongs_to_many :users, join_table: :g5_authenticatable_users_roles

    if Rails::VERSION::MAJOR >= 5
      belongs_to :resource, polymorphic: true, optional: true
    else
      belongs_to :resource, polymorphic: true
    end

    scopify
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
g5_authenticatable-1.1.4 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.4.rc.3 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.4.rc.2 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.4.rc.1 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.2 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.2.pre.1 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.2.rc.5 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.2.rc.4 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.2.rc.3 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.2.rc.2 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.2.rc.1 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.1 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.1.0 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.0.0 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.0.0.pre.4 app/models/g5_authenticatable/role.rb
g5_authenticatable-1.0.0.pre.3 app/models/g5_authenticatable/role.rb