gitlab-org--gitlab-foss/app/models/concerns/presentable.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
337 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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