Class: CafeCar::ActiveRecord::RelationPresenter
- Inherits:
-
Object
- Object
- CafeCar::ActiveRecord::RelationPresenter
- Defined in:
- app/presenters/cafe_car/active_record/relation_presenter.rb
Instance Method Summary collapse
Instance Method Details
#each ⇒ Object
8 |
# File 'app/presenters/cafe_car/active_record/relation_presenter.rb', line 8 def each = object.each { yield present(_1) } |
#human(attribute, **options) ⇒ Object
4 5 6 |
# File 'app/presenters/cafe_car/active_record/relation_presenter.rb', line 4 def human(attribute, **) object.human_attribute_name(attribute, ) end |
#to_html ⇒ Object
10 11 12 13 14 |
# File 'app/presenters/cafe_car/active_record/relation_presenter.rb', line 10 def to_html objects = object.to_a.uniq objects = objects.sort_by(&:sort_key) if objects.first.respond_to?(:sort_key) present objects, count: object.count, **@options end |