2018-08-03 13:22:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-09 15:47:15 -05:00
|
|
|
module Presentable
|
2018-04-05 17:04:42 -04:00
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
class_methods do
|
|
|
|
def present(attributes)
|
|
|
|
all.map { |klass_object| klass_object.present(attributes) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-01-09 15:47:15 -05:00
|
|
|
def present(**attributes)
|
|
|
|
Gitlab::View::Presenter::Factory
|
|
|
|
.new(self, attributes)
|
|
|
|
.fabricate!
|
|
|
|
end
|
|
|
|
end
|