Sha256: 69977ca6334f776f4ffa93200014b88e97752a5648d23965e94cdc7e0bc00935

Contents?: true

Size: 975 Bytes

Versions: 16

Compression:

Stored size: 975 Bytes

Contents

module Maestrano::Connector::Rails::Concerns::User
  extend ActiveSupport::Concern

  included do
    # Enable Maestrano for this user
    maestrano_user_via :provider, :uid, :tenant do |user, maestrano|
      user.uid = maestrano.uid
      user.provider = maestrano.provider
      user.first_name = maestrano.first_name
      user.last_name = maestrano.last_name
      user.email = maestrano.email
      user.tenant = 'default' # To be set from SSO parameter
    end

    #===================================
    # Associations
    #===================================
    has_many :user_organization_rels, class_name: 'Maestrano::Connector::Rails::UserOrganizationRel'
    has_many :organizations, through: :user_organization_rels, class_name: 'Maestrano::Connector::Rails::Organization'

    #===================================
    # Validation
    #===================================
    validates :email, presence: true
    validates :tenant, presence: true
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.3.6 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.3.5 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.3.4 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.3.3 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.3.2 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.3.1 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.3.0 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.2.1 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.2.0 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.1.3 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.1.2 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.1.1 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.1.0 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.0.2.pre.RC12 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.0.2.pre.RC11 app/models/maestrano/connector/rails/concerns/user.rb
maestrano-connector-rails-2.0.2.pre.RC10 app/models/maestrano/connector/rails/concerns/user.rb