Class: FacetedSearch::Facets::Tree
- Inherits:
-
DefaultList
- Object
- Default
- DefaultList
- FacetedSearch::Facets::Tree
- Defined in:
- app/models/faceted_search/facets/tree.rb
Instance Attribute Summary
Attributes inherited from Default
Instance Method Summary collapse
- #children_scope ⇒ Object
- #selected_object ⇒ Object
- #selected_objects ⇒ Object
-
#values ⇒ Object
All values, not filtered Otherwise, we would need to search all the children to do a good filtering.
Methods inherited from DefaultList
#add_scope, #display_method, #find_by, #path_for, #source, #value_selected?
Methods inherited from Default
#add_scope, #initialize, #kind, #path, #path_for, #title, #to_s
Constructor Details
This class inherits a constructor from FacetedSearch::Facets::Default
Instance Method Details
#children_scope ⇒ Object
4 5 6 |
# File 'app/models/faceted_search/facets/tree.rb', line 4 def children_scope @options[:children_scope] ||= Proc.new { |children| children } end |
#selected_object ⇒ Object
12 13 14 |
# File 'app/models/faceted_search/facets/tree.rb', line 12 def selected_object source.find_by(find_by => params_array.last) end |
#selected_objects ⇒ Object
8 9 10 |
# File 'app/models/faceted_search/facets/tree.rb', line 8 def selected_objects source.where(find_by => params_array) end |
#values ⇒ Object
All values, not filtered Otherwise, we would need to search all the children to do a good filtering
18 19 20 21 |
# File 'app/models/faceted_search/facets/tree.rb', line 18 def values root? ? values_root : values_children end |