diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-09 23:47:15 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-18 18:38:34 +0300 |
commit | 78874519db2ca2f18a2fbca5fe070292e521d0c1 (patch) | |
tree | b5b72b3f1f4845669f0da53e9a513c2f58cb495f /app/models | |
parent | e5a29b451473c6f188d5096f21055d27a51fdf90 (diff) |
Add Presentable concern
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 1 | ||||
-rw-r--r-- | app/models/concerns/presentable.rb | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 48ffe40abc6..ce23c2d1088 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -2,6 +2,7 @@ module Ci class Build < CommitStatus include TokenAuthenticatable include AfterCommitQueue + include Presentable belongs_to :runner belongs_to :trigger_request diff --git a/app/models/concerns/presentable.rb b/app/models/concerns/presentable.rb new file mode 100644 index 00000000000..7b33b837004 --- /dev/null +++ b/app/models/concerns/presentable.rb @@ -0,0 +1,7 @@ +module Presentable + def present(**attributes) + Gitlab::View::Presenter::Factory + .new(self, attributes) + .fabricate! + end +end |