Module: IndexView::CustomizationDefaults
- Included in:
- Base
- Defined in:
- lib/index_view/customization_defaults.rb
Overview
The following methods are safe to override in descendent classes
Constant Summary collapse
- DEFAULT_PAGINATION_NUMBER =
30
Instance Method Summary collapse
- #default_sort_direction ⇒ Object
- #default_sort_term ⇒ Object
- #per_page ⇒ Object
- #secondary_sort_term ⇒ Object
- #target_class ⇒ Object
Instance Method Details
#default_sort_direction ⇒ Object
24 25 26 |
# File 'lib/index_view/customization_defaults.rb', line 24 def default_sort_direction Implementation::DESC end |
#default_sort_term ⇒ Object
16 17 18 |
# File 'lib/index_view/customization_defaults.rb', line 16 def default_sort_term raise NotImplementedError, "default_sort_term must be defined" end |
#per_page ⇒ Object
10 11 12 13 14 |
# File 'lib/index_view/customization_defaults.rb', line 10 def per_page target_class.respond_to?(:per_page) ? target_class.per_page : DEFAULT_PAGINATION_NUMBER end |
#secondary_sort_term ⇒ Object
20 21 22 |
# File 'lib/index_view/customization_defaults.rb', line 20 def secondary_sort_term nil end |
#target_class ⇒ Object
6 7 8 |
# File 'lib/index_view/customization_defaults.rb', line 6 def target_class raise NotImplementedError end |