Class: Spree::Core::Search::Base
- Inherits:
-
Object
- Object
- Spree::Core::Search::Base
- Defined in:
- lib/spree/core/search/base.rb
Defined Under Namespace
Classes: InvalidOptions
Instance Attribute Summary collapse
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#pricing_options ⇒ Object
Returns the value of attribute pricing_options.
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
-
#initialize(params) ⇒ Base
constructor
A new instance of Base.
- #retrieve_products ⇒ Object
Constructor Details
Instance Attribute Details
#current_user ⇒ Object
Returns the value of attribute current_user.
14 15 16 |
# File 'lib/spree/core/search/base.rb', line 14 def current_user @current_user end |
#pricing_options ⇒ Object
Returns the value of attribute pricing_options.
15 16 17 |
# File 'lib/spree/core/search/base.rb', line 15 def @pricing_options end |
#properties ⇒ Object
Returns the value of attribute properties.
13 14 15 |
# File 'lib/spree/core/search/base.rb', line 13 def properties @properties end |
Instance Method Details
#retrieve_products ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/spree/core/search/base.rb', line 23 def retrieve_products @products = get_base_scope curr_page = @properties[:page] || 1 unless Spree::Config.show_products_without_price @products = @products.joins(:prices).merge(Spree::Price.where(.search_arguments)).distinct end @products = @products.page(curr_page).per(@properties[:per_page]) end |