Module: Repertoire::Faceting::Relation::QueryMethods
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActiveRecord::Relation
- Defined in:
- lib/repertoire-faceting/relation/query_methods.rb
Instance Attribute Summary collapse
-
#minimum_value ⇒ Object
N.B.
-
#nils_value ⇒ Object
N.B.
-
#refine_value ⇒ Object
N.B.
Instance Method Summary collapse
- #minimum(count) ⇒ Object
- #nils(include_nils = true) ⇒ Object
-
#refine(opts) ⇒ Object
Methods for managing refinements hash.
- #refined_facets? ⇒ Boolean
- #reorder(*args) ⇒ Object
Instance Attribute Details
#minimum_value ⇒ Object
N.B. These methods augment those defined in active_record/relation/query_methods
9 10 11 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 9 def minimum_value @minimum_value end |
#nils_value ⇒ Object
N.B. These methods augment those defined in active_record/relation/query_methods
9 10 11 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 9 def nils_value @nils_value end |
#refine_value ⇒ Object
N.B. These methods augment those defined in active_record/relation/query_methods
9 10 11 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 9 def refine_value @refine_value end |
Instance Method Details
#minimum(count) ⇒ Object
27 28 29 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 27 def minimum(count) clone.tap { |f| f.minimum_value = count } end |
#nils(include_nils = true) ⇒ Object
31 32 33 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 31 def nils(include_nils=true) clone.tap { |f| f.nils_value = (if include_nils then :include else :exclude end) } end |
#refine(opts) ⇒ Object
Methods for managing refinements hash
23 24 25 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 23 def refine(opts) clone.tap { |r| r.refine_value = merge_hashes(r.refine_value, opts) } end |
#refined_facets? ⇒ Boolean
39 40 41 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 39 def refined_facets? !refine_value.empty? end |
#reorder(*args) ⇒ Object
35 36 37 |
# File 'lib/repertoire-faceting/relation/query_methods.rb', line 35 def reorder(*args) clone.tap { |f| f.order_values = args.flatten } end |