Class: OpenStax::Accounts::Account
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- OpenStax::Accounts::Account
- Defined in:
- app/models/openstax/accounts/account.rb
Direct Known Subclasses
Constant Summary collapse
- USERNAME_DISCARDED_CHAR_REGEX =
/[^A-Za-z\d_]/- USERNAME_MAX_LENGTH =
50- SYNC_ATTRIBUTES =
[ :openstax_uid, :username, :is_administrator, :first_name, :last_name, :full_name, :title, :self_reported_role, :faculty_status, :school_type, :school_location, :salesforce_contact_id, :support_identifier, :is_test, :is_kip, :grant_tutor_access ]
Instance Attribute Summary collapse
-
#syncing ⇒ Object
Returns the value of attribute syncing.
Instance Method Summary collapse
- #casual_name ⇒ Object
- #has_authenticated? ⇒ Boolean
- #is_anonymous? ⇒ Boolean
- #name ⇒ Object
- #self_reported_role ⇒ Object
- #self_reported_role=(role) ⇒ Object
- #valid_openstax_uid? ⇒ Boolean
Instance Attribute Details
#syncing ⇒ Object
Returns the value of attribute syncing.
24 25 26 |
# File 'app/models/openstax/accounts/account.rb', line 24 def syncing @syncing end |
Instance Method Details
#casual_name ⇒ Object
72 73 74 |
# File 'app/models/openstax/accounts/account.rb', line 72 def casual_name first_name || username end |
#has_authenticated? ⇒ Boolean
80 81 82 |
# File 'app/models/openstax/accounts/account.rb', line 80 def has_authenticated? !access_token.nil? end |
#is_anonymous? ⇒ Boolean
76 77 78 |
# File 'app/models/openstax/accounts/account.rb', line 76 def is_anonymous? false end |
#name ⇒ Object
68 69 70 |
# File 'app/models/openstax/accounts/account.rb', line 68 def name (first_name || last_name) ? [first_name, last_name].compact.join(" ") : username end |
#self_reported_role ⇒ Object
88 89 90 |
# File 'app/models/openstax/accounts/account.rb', line 88 def self_reported_role role end |
#self_reported_role=(role) ⇒ Object
92 93 94 |
# File 'app/models/openstax/accounts/account.rb', line 92 def self_reported_role=(role) self.role = role end |
#valid_openstax_uid? ⇒ Boolean
84 85 86 |
# File 'app/models/openstax/accounts/account.rb', line 84 def valid_openstax_uid? !openstax_uid.nil? && openstax_uid > 0 end |