2017-08-17 22:00:37 +05:30
|
|
|
module Presentable
|
2018-05-09 12:01:36 +05:30
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
class_methods do
|
|
|
|
def present(attributes)
|
|
|
|
all.map { |klass_object| klass_object.present(attributes) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def present(**attributes)
|
|
|
|
Gitlab::View::Presenter::Factory
|
|
|
|
.new(self, attributes)
|
|
|
|
.fabricate!
|
|
|
|
end
|
|
|
|
end
|