diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 16:35:08 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:32:42 -0600 |
commit | b3ff48c9a1d61b22ab4040ebcdc64eeeb797ad44 (patch) | |
tree | e73552a1d8f27dd510e0bde264b6d24648fc2bfc /app/models/concerns/issuable.rb | |
parent | 0a5b670a9392f7f8c02e83f1c2e3ed4d2d67cfde (diff) | |
download | gitlab-ce-b3ff48c9a1d61b22ab4040ebcdc64eeeb797ad44.tar.gz |
Move up delegate calls
Diffstat (limited to 'app/models/concerns/issuable.rb')
-rw-r--r-- | app/models/concerns/issuable.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 8b33e776e87..fcb335e48d1 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -46,6 +46,17 @@ module Issuable has_one :metrics + delegate :name, + :email, + to: :author, + prefix: true + + delegate :name, + :email, + to: :assignee, + allow_nil: true, + prefix: true + validates :author, presence: true validates :title, presence: true, length: { maximum: 255 } @@ -72,17 +83,6 @@ module Issuable scope :references_project, -> { references(:project) } scope :non_archived, -> { join_project.where(projects: { archived: false }) } - delegate :name, - :email, - to: :author, - prefix: true - - delegate :name, - :email, - to: :assignee, - allow_nil: true, - prefix: true - attr_mentionable :title, pipeline: :single_line attr_mentionable :description |