Files
grecia/app/components/relationable/related_list_component.rb
Javi Martín a1439d0790 Apply Layout/LineLength rubocop rule
Note we're excluding a few files:

* Configuration files that weren't generated by us
* Migration files that weren't generated by us
* The Gemfile, since it includes an important comment that must be on
  the same line as the gem declaration
* The Budget::Stats class, since the heading statistics are a mess and
  having shorter lines would require a lot of refactoring
2023-08-30 14:46:35 +02:00

21 lines
489 B
Ruby

class Relationable::RelatedListComponent < ApplicationComponent
attr_reader :relationable
delegate :current_user, to: :helpers
def initialize(relationable)
@relationable = relationable
end
def render?
related_contents.present?
end
private
def related_contents
@related_contents ||= Kaminari.paginate_array(relationable.relationed_contents)
.page(params[:page])
.per(5)
end
end