app/models/openstax/accounts/account.rb in openstax_accounts-7.9.0 vs app/models/openstax/accounts/account.rb in openstax_accounts-7.10.0
- old
+ new
@@ -18,21 +18,21 @@
primary_key: :openstax_uid,
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]
+ 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
validates :openstax_uid, uniqueness: { allow_nil: true }
validates :username, uniqueness: { allow_nil: true }
- validates :uuid, uniqueness: { allow_nil: true }
+ validates :uuid, presence: true, uniqueness: true
+ validates :support_identifier, uniqueness: { allow_nil: true }
before_update :update_openstax_accounts, if: :should_send_updates_to_accounts?
def name
(first_name || last_name) ? [first_name, last_name].compact.join(" ") : username