Class: FortyFacets::SqlFacetFilterDefinition
- Inherits:
-
FilterDefinition
- Object
- FilterDefinition
- FortyFacets::SqlFacetFilterDefinition
- Defined in:
- lib/forty_facets/filter/sql_facet_filter_definition.rb
Defined Under Namespace
Classes: ScopeFacetFilter
Instance Attribute Summary collapse
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
Attributes inherited from FilterDefinition
#association, #attribute, #column_name, #joins, #options, #origin_class, #path, #search, #table_name
Instance Method Summary collapse
- #build_filter(search_instance, param_value) ⇒ Object
-
#initialize(search, queries, opts) ⇒ SqlFacetFilterDefinition
constructor
A new instance of SqlFacetFilterDefinition.
- #request_param ⇒ Object
Methods inherited from FilterDefinition
Constructor Details
#initialize(search, queries, opts) ⇒ SqlFacetFilterDefinition
Returns a new instance of SqlFacetFilterDefinition.
5 6 7 8 9 10 11 12 |
# File 'lib/forty_facets/filter/sql_facet_filter_definition.rb', line 5 def initialize(search, queries, opts) @search = search @queries = queries @path = Array(opts[:path]) if opts[:path].present? @joins = Array(opts[:joins]) if opts[:joins].present? @path ||= @queries.keys @options = opts end |
Instance Attribute Details
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
3 4 5 |
# File 'lib/forty_facets/filter/sql_facet_filter_definition.rb', line 3 def queries @queries end |
Instance Method Details
#build_filter(search_instance, param_value) ⇒ Object
18 19 20 |
# File 'lib/forty_facets/filter/sql_facet_filter_definition.rb', line 18 def build_filter(search_instance, param_value) ScopeFacetFilter.new(self, search_instance, param_value) end |
#request_param ⇒ Object
14 15 16 |
# File 'lib/forty_facets/filter/sql_facet_filter_definition.rb', line 14 def request_param path.join("-") end |