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

Created promotion seed #8726

Merged
merged 1 commit into from May 14, 2018

Conversation

WitekL
Copy link
Contributor

@WitekL WitekL commented May 8, 2018

No description provided.

Spree::PromotionRule.where(
promotion_id: promotion.id,
type: 'Spree::Promotion::Rules::OptionValue',
preferences: { match_policy: 'any', eligible_values: { '6' => '5,1' } }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded ID

@bbonislawski bbonislawski merged commit f1dedf4 into spree:master May 14, 2018
@bbonislawski bbonislawski deleted the create-promotion-seed branch May 14, 2018 08:05
@safeforge
Copy link

@WitekL after this merge seems to be not possible to install spree (3.6.1) with seeds and without samples on rails (5.2.0)

$ rails g spree:install --migrate=true --sample=false --seed=true --copy_views=false

...
loading ruby ../spree_core-3.6.1/db/default/spree/countries.rb
loading ruby ../spree_core-3.6.1/db/default/spree/default_reimbursement_type.rb
loading ruby ../spree_core-3.6.1/db/default/spree/promotions.rb
Loaded Option Types samples
Loaded Option Values samples
Loaded Tax Categories samples
Loaded Shipping Categories samples
Loaded Products samples
loading ruby ../spree_core-3.6.1/db/default/spree/roles.rb
loading ruby ../spree_core-3.6.1/db/default/spree/states.rb
loading ruby ../spree_core-3.6.1/db/default/spree/stores.rb
loading ruby ../spree_core-3.6.1/db/default/spree/zones.rb
loading ruby ../spree_auth_devise-3.3.3/db/default/users.rb
...

my expectations was to have a database with seeds without products, but in the console:

irb(main):002:0> Spree::Product.count
   (1.0ms)  SELECT COUNT(*) FROM "spree_products" WHERE "spree_products"."deleted_at" IS NULL
=> 16

spree should works without promotions and I was wondering if it's a good idea to move core/db/default/spree/promotions.rb in sample/db/sample/promotions.rb

/cc @bbonislawski @damianlegawiec

@WitekL
Copy link
Contributor Author

WitekL commented Jul 2, 2018

@safeforge Thanks for reporting this issue. I will attend to it right away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants