debian-mirror-gitlab/app/models/concerns/presentable.rb
2018-05-09 12:01:36 +05:30

15 lines
302 B
Ruby

module Presentable
extend ActiveSupport::Concern
class_methods do
def present(attributes)
all.map { |klass_object| klass_object.present(attributes) }
end
end
def present(**attributes)
Gitlab::View::Presenter::Factory
.new(self, attributes)
.fabricate!
end
end