Sha256: b09b5de21c30eb2e39baeb75f53c48ae3f26bb0472c53e45adaf320bdbaf9c4a

Contents?: true

Size: 658 Bytes

Versions: 8

Compression:

Stored size: 658 Bytes

Contents

class User < ActiveRecord::Base
  if Authentication.type.saml?
    devise :saml_authenticatable, :rememberable
  else
    # both database and disabled authentication styles use devise 'database_authentication'
    # disabled actually just signs in a guest user for every request from application_controller
    devise :database_authenticatable, :rememberable
  end

  has_many :query_versions
  has_many :queries, through: :query_versions
  has_many :snippets

  serialize :groups

  def self.guest_user
    where(email: 'guest-user@test.com', role: Role::ADMIN_ROLE, name: 'Guest').first_or_create
  end

  def admin?
    role == Role::ADMIN_ROLE
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev app/models/user.rb
aleph_analytics-0.4.8 app/models/user.rb
aleph_analytics-0.4.7 app/models/user.rb
aleph_analytics-0.4.4 app/models/user.rb
aleph_analytics-0.4.2 app/models/user.rb
aleph_analytics-0.4.1 app/models/user.rb
aleph_analytics-0.3.0 app/models/user.rb
aleph_analytics-0.2.0 app/models/user.rb