diff --git a/app/models/user.rb b/app/models/user.rb index 1f3373fae..67476768d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,9 +1,6 @@ class User < ApplicationRecord belongs_to :account - has_many :assignments - has_many :assigned, through: :assignments, source: :bubble - has_many :sessions, dependent: :destroy has_secure_password validations: false @@ -11,6 +8,10 @@ class User < ApplicationRecord has_many :projects, through: :accesses has_many :bubbles, through: :projects + has_many :assignments + has_many :assigned_bubbles, through: :assignments, source: :bubble + + validates_presence_of :email_address normalizes :email_address, with: ->(value) { value.strip.downcase } scope :active, -> { where(active: true) }