Sha256: ff8469745bd09b1d234ad7aa3578d6ae382a041f66b35f5db2bc4aa040162aaa

Contents?: true

Size: 825 Bytes

Versions: 34

Compression:

Stored size: 825 Bytes

Contents

module Maestrano::Connector::Rails
  class User < ActiveRecord::Base
    # 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
    has_many :organizations, through: :user_organization_rels

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

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.0.pre.RC5 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-2.0.0.pre.RC4 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-2.0.0.pre.RC3 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-2.0.0.pre.RC2 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-2.0.0.pre.RC1 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.4.0 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.3.5 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.3.4 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.3.3 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.3.2 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.3.1 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.3.0 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.2.3 app/models/maestrano/connector/rails/user.rb
maestrano-connector-rails-1.2.2 app/models/maestrano/connector/rails/user.rb