Refactor Valuator#name_and_email

This commit is contained in:
kikito
2016-03-08 15:16:05 +01:00
parent ffd09bc490
commit 35b296cf0e

View File

@@ -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