Comments (8)
Could you please provide more thorough steps for us to reproduce the issue, including steps that clearly indicate that this is not performing correctly?
Thanks!
from spree_product_groups.
Here is my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2'
gem 'coffee-rails', '~> 3.2'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test, :development do
# Use thin so that I can see the overrides in action
gem 'thin'
# Pretty printed test output
gem 'turn', '0.8.2', :require => false
gem 'ffaker'
gem 'guard-spork'
gem 'factory_girl'
gem 'rspec-rails'
gem 'capybara'
gem 'guard-rspec'
gem 'launchy'
gem 'diffy'
end
# gem 'thin'
gem 'execjs'
# Use of therubyracer is discouraged:
# See: https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar#troubleshooting
# gem 'therubyracer'
# gem 'whenever', :require => false
gem 'delayed_job_active_record'
gem 'spree', :git => 'git://github.com/spree/spree', :branch => '1-1-stable'
gem 'spree_gateway', :git => 'git://github.com/spree/spree_gateway.git'
gem 'spree_product_groups', :git => 'git://github.com/spree/spree_product_groups.git'
gem 'spree_address_book', :git => 'git://github.com/danrasband/spree_address_book.git', :branch => '1.1.0'
gem 'spree_reuse_credit_card', :git => 'git://github.com/danrasband/spree_reuse_credit_card.git', :branch => '1.1.0'
gem 'spree_wishlist', :git => 'git://github.com/spree/spree_wishlist.git', :tag => "v1.3"
gem 'spree_email_to_friend', :git => 'git://github.com/spree/spree_email_to_friend.git'
gem 'spree_dynamic_sitemaps', :git => 'git://github.com/danrasband/spree_dynamic_sitemaps'
gem 'spree_reviews', :git => 'git://github.com/spree/spree_reviews'
gem 'spree_essentials', :git => 'git://github.com/citrus/spree_essentials.git', :branch => 'master'
gem 'spree_essential_blog', :git => 'git://github.com/citrus/spree_essential_blog.git', :branch => 'master'
# these three are for editing static content pages
gem 'spree_static_content', :git => 'git://github.com/spree/spree_static_content.git'
gem 'spree_editor', :git => 'git://raw.github.com/spree/spree_editor.git'
gem 'tinymce-rails', '>= 3.4.7.0.1'
It is happening when I follow these steps:
- Add a product or two
- Create a group and add products to it using the scope of "Products with IDs"
- Update the group
All is fine and dandy at this point. Then:
- Add a new product or edit a product that is not in your product group
- Go back to the product groups listing and you will see that the count is one more than it should be
- Open the product group and the list at the bottom shows the product you just added/edited
- Hit 'Update' without making any changes, and the product you just added/edited disappears and the group is as it should be.
from spree_product_groups.
Sorry to be a bother, but did you have a chance to look into this?
from spree_product_groups.
No not yet. I can look at it this week for you.
from spree_product_groups.
I can see the same behavior at times and that makes it harder to fix. I couldn't find out why, but its getting more and more common in production. I've scheduled a job after every product update to touch all group memberships ProductGroup.all.map(&:update_memberships)
. It also updates products in product groups based on price, another feature that I couldn't see working until now.
from spree_product_groups.
I also have the same problem. I have a product group set up via product ids and each time I edit a product it gets added to that product group until I do an update_memberships.
I believe the problem is that ProductGroup#include?
is always returning true for a product group set up via product ids. This method is called for each product group after a product is saved and, as it returns true, an entry gets added in spree_product_groups_products for that product. When update_memberships gets called on the product group the associations get re-built correctly.
I have written a couple of tests and tweaked the way ProductGroup#include?
works. This seems to work ok for me now, so here is the link to my changes. However, I am thinking that it may be better to change the way the scopes are merged in ProductScope#apply_on
instead of this tweak to the scope, if that's feasible?
stefansenk@3247fc2
from spree_product_groups.
I have this same issue on 1-3-stable. @stefansenk fix stefansenk/spree_product_groups@3247fc2 fixes the issue for me.
from spree_product_groups.
I'm using spree_core at 1.1.7.beta and spree_product_groups at 1-3-stable and @stefansenk fix works for me too.
I don't know what is the trick, the first where syntax and the second returns the same, but it actually fixes the problem.
from spree_product_groups.
Related Issues (15)
- Products groups permalink translated from russian with letter "Ь"
- Using product groups on homepage HOT 1
- Upgrade Spree Dependency
- zoom links to image rather than opening lightbox HOT 1
- Rails 4.0 Upgrade Problems HOT 5
- Spree 2.0 no support for russian lang HOT 1
- Spree 2.0 undefined method `>' for {}:ActiveSupport::OrderedHash HOT 1
- Spree 2.1 - Error when trying to access Products Groups in admin HOT 5
- Documentation Is wrong for looking up info on scopes and product groups. HOT 8
- group_by_products_ids not found
- e
- Allow all spree organization members to have commit access HOT 1
- Setup travis ci hooks
- Lack of GROUP BY clause cause postgres error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spree_product_groups.