Refactor Valuator#name_and_email
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
class Valuator < ActiveRecord::Base
|
||||
belongs_to :user, touch: true
|
||||
delegate :name, :email, to: :user
|
||||
delegate :name, :email, :name_and_email, to: :user
|
||||
|
||||
has_many :valuation_assignments, dependent: :destroy
|
||||
has_many :spending_proposals, through: :valuation_assignments
|
||||
|
||||
validates :user_id, presence: true, uniqueness: true
|
||||
|
||||
def name_and_email
|
||||
"#{name} (#{email})"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user