app/models/openstax/accounts/account.rb in openstax_accounts-7.12.0 vs app/models/openstax/accounts/account.rb in openstax_accounts-7.13.0

- old
+ new

@@ -19,17 +19,15 @@ foreign_key: :user_id, inverse_of: :user has_many :groups_as_member, through: :group_members, source: :group enum faculty_status: [:no_faculty_info, :pending_faculty, :confirmed_faculty, :rejected_faculty] - - after_initialize :set_default_faculty_status - validates :faculty_status, presence: true - enum role: [:unknown_role, :student, :instructor, :administrator, :librarian, :designer, :other] - validates :role, presence: true + enum school_type: [:unknown_school_type, :other_school_type, :college] + validates :faculty_status, :role, :school_type, presence: true + validates :openstax_uid, uniqueness: { allow_nil: true } validates :username, uniqueness: { allow_nil: true } validates :uuid, presence: true, uniqueness: true validates :support_identifier, uniqueness: { allow_nil: true } @@ -54,13 +52,9 @@ def valid_openstax_uid? !openstax_uid.nil? && openstax_uid > 0 end protected - - def set_default_faculty_status - self.faculty_status ||= :no_faculty_info - end def syncing_or_stubbing? syncing || OpenStax::Accounts.configuration.enable_stubbing? end