refactors Admin#name_and_email

This commit is contained in:
rgarcia
2016-03-08 15:45:58 +01:00
parent 13fea09613
commit 37c1c31bfe

View File

@@ -1,10 +1,6 @@
class Administrator < ActiveRecord::Base
belongs_to :user, touch: true
delegate :name, :email, to: :user
delegate :name, :email, :name_and_email, to: :user
validates :user_id, presence: true, uniqueness: true
def name_and_email
"#{name} (#{email})"
end
end