From 7336df05ff1a7e7d1e42591f56c0165ad0b32bc0 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Tue, 1 Jul 2014 10:49:30 +1000 Subject: [PATCH 1/3] Use Spree 2-3-stable --- Gemfile | 4 ++-- spree_fancy.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index bf1d7da..d2727c7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' -gem 'spree', github: 'spree/spree', :branch => 'master' +gem 'spree', github: 'spree/spree', :branch => '2-3-stable' # Provides basic authentication functionality for testing parts of your engine -gem 'spree_auth_devise', github: "spree/spree_auth_devise", :branch => 'master' +gem 'spree_auth_devise', github: "spree/spree_auth_devise", :branch => '2-3-stable' gemspec diff --git a/spree_fancy.gemspec b/spree_fancy.gemspec index 33cd091..39accce 100644 --- a/spree_fancy.gemspec +++ b/spree_fancy.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.requirements << 'none' - s.add_dependency 'spree_core', '~> 2.3.0.beta' + s.add_dependency 'spree_core', '~> 2.3.0' s.add_dependency 'compass-rails' s.add_dependency 'jquery-ui-rails' s.add_dependency 'deface', '~> 1.0.0rc3' From 7d5d135e7a38af6a2f058b576e562bee120d6785 Mon Sep 17 00:00:00 2001 From: Shane Weng Date: Mon, 20 Oct 2014 10:12:41 -0700 Subject: [PATCH 2/3] fixed duplicated items in slider, featured and latest products --- app/controllers/spree/home_controller_decorator.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/spree/home_controller_decorator.rb b/app/controllers/spree/home_controller_decorator.rb index 348ac89..75d75db 100644 --- a/app/controllers/spree/home_controller_decorator.rb +++ b/app/controllers/spree/home_controller_decorator.rb @@ -1,14 +1,18 @@ Spree::HomeController.class_eval do def index + uniq_item = "DISTINCT (spree_products.id), spree_products.*, spree_products_taxons.position" slider = Spree::Taxon.where(:name => 'Slider').first @slider_products = slider.products.active if slider + @slider_products = @slider_products.select(uniq_item) featured = Spree::Taxon.where(:name => 'Featured').first @featured_products = featured.products.active if featured + @featured_products = @featured_products.select(uniq_item) latest = Spree::Taxon.where(:name => 'Latest').first @latest_products = latest.products.active if latest + @latest_products = @latest_products.select(uniq_item) end end From 50b50388b30a27fab77ad459077407d2fb0ee30e Mon Sep 17 00:00:00 2001 From: Shane Weng Date: Fri, 28 Nov 2014 18:26:26 -0800 Subject: [PATCH 3/3] add condition to check array is not nil --- app/controllers/spree/home_controller_decorator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/spree/home_controller_decorator.rb b/app/controllers/spree/home_controller_decorator.rb index 75d75db..2af67fb 100644 --- a/app/controllers/spree/home_controller_decorator.rb +++ b/app/controllers/spree/home_controller_decorator.rb @@ -4,15 +4,15 @@ def index uniq_item = "DISTINCT (spree_products.id), spree_products.*, spree_products_taxons.position" slider = Spree::Taxon.where(:name => 'Slider').first @slider_products = slider.products.active if slider - @slider_products = @slider_products.select(uniq_item) + @slider_products = @slider_products.select(uniq_item) if @slider_products featured = Spree::Taxon.where(:name => 'Featured').first @featured_products = featured.products.active if featured - @featured_products = @featured_products.select(uniq_item) + @featured_products = @featured_products.select(uniq_item) if @featured_products latest = Spree::Taxon.where(:name => 'Latest').first @latest_products = latest.products.active if latest - @latest_products = @latest_products.select(uniq_item) + @latest_products = @latest_products.select(uniq_item) if @latest_products end end