Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Array#paginate call with will_paginate 3.0.0 #15

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Jeweler::Tasks.new do |s|
s.email = "[email protected]"
s.homepage = "http://github.com/romul/spree-solr-search"
s.authors = ["Roman Smirnov"]
s.add_dependency 'spree_core', ['>= 0.30.1']
s.add_dependency 'spree_core', ['>= 0.70.99']
s.add_dependency 'acts_as_solr_reloaded', ['>= 1.6.0']
s.has_rdoc = false
#s.extra_rdoc_files = [ "README.rdoc"]
Expand Down
2 changes: 1 addition & 1 deletion app/models/product_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Product.class_eval do
acts_as_solr :fields => PRODUCT_SOLR_FIELDS, :facets => PRODUCT_SOLR_FACETS rescue nil
acts_as_solr :fields => PRODUCT_SOLR_FIELDS, :facets => PRODUCT_SOLR_FACETS, :include => PRODUCT_SOLR_INCLUDE rescue nil

def taxon_ids
taxons.map(&:id)
Expand Down
6 changes: 6 additions & 0 deletions app/overrides/solr_facets_in_search_results.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Deface::Override.new(
:virtual_path => "products/index",
:name => "solr_facets_in_search_results",
:insert_before => "[data-hook='search_results']",
:partial => "products/facets",
:disabled => false)
6 changes: 6 additions & 0 deletions app/overrides/solr_suggestion_in_search_results.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Deface::Override.new(
:virtual_path => "products/index",
:name => "solr_suggestion_in_search_results",
:insert_before => "[data-hook='search_results']",
:partial => "products/suggestion",
:disabled => false)
3 changes: 3 additions & 0 deletions config/initializers/solr_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
PRODUCT_SOLR_FACETS = [:price_range, :taxon_names,
:brand_property, :color_option, :size_option]
end
unless defined?(PRODUCT_SOLR_INCLUDE)
PRODUCT_SOLR_INCLUDE = []
end
6 changes: 2 additions & 4 deletions lib/spree/search/solr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ def get_products_conditions_for(base_scope, query)
full_query += " AND store_ids:(#{current_store_id})" if current_store_id

result = Product.find_by_solr(full_query, search_options)

count = result.records.size
products = result.records.paginate(:page => page, :per_page => per_page, :total_entries => count)

products = Kaminari.paginate_array(result.records).page(page).per(per_page)

@properties[:products] = products
@properties[:suggest] = nil
begin
Expand Down
1 change: 0 additions & 1 deletion lib/spree_solr_search.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'spree_core'
require 'spree_solr_search_hooks'

module SpreeSolrSearch
class Engine < Rails::Engine
Expand Down
6 changes: 0 additions & 6 deletions lib/spree_solr_search_hooks.rb

This file was deleted.

69 changes: 28 additions & 41 deletions spree_solr_search.gemspec
Original file line number Diff line number Diff line change
@@ -1,62 +1,49 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{spree_solr_search}
s.version = "0.40.3"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Roman Smirnov"]
s.date = %q{2011-03-21}
s.authors = [%q{Roman Smirnov}]
s.date = %q{2011-08-11}
s.description = %q{Provides search via Apache Solr for a Spree store.}
s.email = %q{[email protected]}
s.extra_rdoc_files = [
"README.md"
]
s.files = [
".gitignore",
"README.md",
"Rakefile",
"VERSION",
"app/helpers/spree/base_helper_decorator.rb",
"app/models/product_decorator.rb",
"app/views/products/_facets.html.erb",
"app/views/products/_suggestion.html.erb",
"config/initializers/solr_config.rb",
"config/locales/en.yml",
"config/locales/ru-RU.yml",
"config/locales/ru.yml",
"lib/generators/spree_solr_search/install_generator.rb",
"lib/generators/templates/solr.yml",
"lib/spree/search/solr.rb",
"lib/spree_solr_search.rb",
"lib/spree_solr_search_hooks.rb",
"lib/tasks/acts_as_solr.rake",
"lib/websolr_acts_as_solr.rb",
"spree_solr_search.gemspec"
"README.md",
"Rakefile",
"VERSION",
"Versionfile",
"app/helpers/spree/base_helper_decorator.rb",
"app/models/product_decorator.rb",
"app/views/products/_facets.html.erb",
"app/views/products/_suggestion.html.erb",
"config/initializers/solr_config.rb",
"config/locales/en.yml",
"config/locales/ru-RU.yml",
"config/locales/ru.yml",
"lib/generators/spree_solr_search/install_generator.rb",
"lib/generators/templates/solr.yml",
"lib/solr_manager.rb",
"lib/spree/search/solr.rb",
"lib/spree_solr_search.rb",
"lib/spree_solr_search_hooks.rb",
"lib/tasks/acts_as_solr.rake",
"lib/websolr_acts_as_solr.rb",
"spree_solr_search.gemspec"
]
s.homepage = %q{http://github.com/romul/spree-solr-search}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.6}
s.require_paths = [%q{lib}]
s.rubygems_version = %q{1.8.7}
s.summary = %q{Provides search via Apache Solr for a Spree store.}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<spree_core>, [">= 0.30.1"])
s.add_runtime_dependency(%q<acts_as_solr_reloaded>, [">= 1.6.0"])
else
s.add_dependency(%q<spree_core>, [">= 0.30.1"])
s.add_dependency(%q<acts_as_solr_reloaded>, [">= 1.6.0"])
end
else
s.add_dependency(%q<spree_core>, [">= 0.30.1"])
s.add_dependency(%q<acts_as_solr_reloaded>, [">= 1.6.0"])
end
s.add_dependency('spree_core', '>= 0.70.0')
s.add_dependency('acts_as_solr_reloaded', '>= 1.6.0')
end