Module: Kaminari::Adapter::RomRelationLoadedExtension
- Includes:
- PageScopeMethods
- Defined in:
- lib/hanami/kaminari/adapter/rom_relation_loaded_extension.rb
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
8 9 10 11 12 |
# File 'lib/hanami/kaminari/adapter/rom_relation_loaded_extension.rb', line 8 def method_missing(name, *args, &block) return super unless name.in? %i[default_per_page max_per_page max_pages] repo_name = (Hanami::Model.container.mappers[self.source.name.relation].elements[:entity].model.to_s + 'Repository').constantize repo_name.send(name, *args, &block) end |