Sha256: f41436da6e0a8308dde0ef02dd4c4e42ae1a5838933771756fc02ac465b4626b
Contents?: true
Size: 749 Bytes
Versions: 45
Compression:
Stored size: 749 Bytes
Contents
class User < ActiveRecord::Base belongs_to :account, class_name: "OpenStax::Accounts::Account" has_many :groups_as_member, through: :account has_many_through_groups :groups_as_member, :ownerships, as: :owner, dependent: :destroy delegate :username, :first_name, :last_name, :full_name, :title, :name, :casual_name, to: :account def is_anonymous? false end # OpenStax Accounts "account_user_mapper" methods def self.account_to_user(acc) acc.is_anonymous? ? \ AnonymousUser.instance : \ User.where(:account_id => acc.id).first end def self.user_to_account(user) user.is_anonymous? ? \ AnonymousAccount.instance : \ user.account end end
Version data entries
45 entries across 45 versions & 1 rubygems