spree_core 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/friendly_id/slug_decorator.rb +3 -0
  3. data/app/models/spree/adjustment.rb +1 -1
  4. data/app/models/spree/calculator.rb +5 -0
  5. data/app/models/spree/customer_return.rb +22 -16
  6. data/app/models/spree/gateway/bogus.rb +4 -0
  7. data/app/models/spree/line_item.rb +1 -1
  8. data/app/models/spree/order.rb +22 -48
  9. data/app/models/spree/order/checkout.rb +270 -255
  10. data/app/models/spree/order_contents.rb +64 -61
  11. data/app/models/spree/order_merger.rb +65 -0
  12. data/app/models/spree/payment.rb +5 -0
  13. data/app/models/spree/payment/processing.rb +2 -1
  14. data/app/models/spree/payment_method/check.rb +12 -2
  15. data/app/models/spree/product.rb +5 -0
  16. data/app/models/spree/promotion_handler/cart.rb +18 -14
  17. data/app/models/spree/shipment.rb +1 -1
  18. data/app/models/spree/stock/availability_validator.rb +10 -9
  19. data/app/models/spree/stock/content_item.rb +8 -0
  20. data/app/models/spree/stock/package.rb +8 -0
  21. data/app/models/spree/stock_item.rb +5 -1
  22. data/app/models/spree/stock_movement.rb +6 -1
  23. data/app/models/spree/variant.rb +18 -15
  24. data/app/models/spree/zone.rb +39 -29
  25. data/app/views/spree/order_mailer/cancel_email.html.erb +1 -1
  26. data/app/views/spree/order_mailer/cancel_email.text.erb +1 -1
  27. data/app/views/spree/order_mailer/confirm_email.html.erb +1 -1
  28. data/app/views/spree/order_mailer/confirm_email.text.erb +1 -1
  29. data/config/initializers/user_class_extensions.rb +4 -0
  30. data/config/locales/en.yml +4 -3
  31. data/db/default/spree/default_reimbursement_type.rb +1 -0
  32. data/db/migrate/20150515211137_fix_adjustment_order_id.rb +70 -0
  33. data/db/migrate/20150522181728_add_deleted_at_to_friendly_id_slugs.rb +6 -0
  34. data/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb +16 -0
  35. data/db/migrate/20150707204155_enable_acts_as_paranoid_on_calculators.rb +6 -0
  36. data/lib/spree/core/controller_helpers/auth.rb +1 -1
  37. data/lib/spree/core/engine.rb +7 -0
  38. data/lib/spree/core/validators/email.rb +7 -3
  39. data/lib/spree/core/version.rb +1 -1
  40. data/lib/spree/permitted_attributes.rb +2 -2
  41. data/lib/spree/testing_support/common_rake.rb +3 -8
  42. data/lib/spree/testing_support/factories.rb +1 -1
  43. data/lib/spree/testing_support/factories/order_factory.rb +11 -0
  44. data/lib/spree/testing_support/order_walkthrough.rb +1 -1
  45. metadata +11 -4
@@ -16,15 +16,10 @@ namespace :common do
16
16
  Spree::InstallGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", "--auto-accept", "--migrate=false", "--seed=false", "--sample=false", "--quiet", "--user_class=#{args[:user_class]}"]
17
17
 
18
18
  puts "Setting up dummy database..."
19
- cmd = "bundle exec rake db:drop db:create db:migrate"
19
+ system("bundle exec rake db:drop db:create db:migrate > #{File::NULL}")
20
20
 
21
- if RUBY_PLATFORM =~ /mswin|mingw/ # windows
22
- cmd += " >nul"
23
- else
24
- cmd += " >/dev/null"
25
- end
26
-
27
- system(cmd)
21
+ puts "Precompiling assets..."
22
+ system("bundle exec rake assets:precompile > #{File::NULL}")
28
23
 
29
24
  begin
30
25
  require "generators/#{ENV['LIB_NAME']}/install/install_generator"
@@ -7,7 +7,7 @@ Spree::Zone.class_eval do
7
7
  end
8
8
 
9
9
  Dir["#{File.dirname(__FILE__)}/factories/**"].each do |f|
10
- require File.expand_path(f)
10
+ load File.expand_path(f)
11
11
  end
12
12
 
13
13
  FactoryGirl.define do
@@ -17,6 +17,17 @@ FactoryGirl.define do
17
17
  end
18
18
  end
19
19
 
20
+ factory :order_with_line_item_quantity do
21
+ transient do
22
+ line_items_quantity 1
23
+ end
24
+
25
+ after(:create) do |order, evaluator|
26
+ create(:line_item, order: order, price: evaluator.line_items_price, quantity: evaluator.line_items_quantity)
27
+ order.line_items.reload # to ensure order.line_items is accessible after
28
+ end
29
+ end
30
+
20
31
  factory :order_with_line_items do
21
32
  bill_address
22
33
  ship_address
@@ -30,7 +30,7 @@ class OrderWalkthrough
30
30
  order.next!
31
31
 
32
32
  end_state_position = states.index(state.to_sym)
33
- states[0..end_state_position].each do |state|
33
+ states[0...end_state_position].each do |state|
34
34
  send(state, order)
35
35
  end
36
36
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -260,14 +260,14 @@ dependencies:
260
260
  requirements:
261
261
  - - "~>"
262
262
  - !ruby/object:Gem::Version
263
- version: 4.2.0
263
+ version: 4.2.2
264
264
  type: :runtime
265
265
  prerelease: false
266
266
  version_requirements: !ruby/object:Gem::Requirement
267
267
  requirements:
268
268
  - - "~>"
269
269
  - !ruby/object:Gem::Version
270
- version: 4.2.0
270
+ version: 4.2.2
271
271
  - !ruby/object:Gem::Dependency
272
272
  name: ransack
273
273
  requirement: !ruby/object:Gem::Requirement
@@ -397,6 +397,7 @@ files:
397
397
  - app/models/concerns/spree/user_api_authentication.rb
398
398
  - app/models/concerns/spree/user_payment_source.rb
399
399
  - app/models/concerns/spree/user_reporting.rb
400
+ - app/models/friendly_id/slug_decorator.rb
400
401
  - app/models/spree/ability.rb
401
402
  - app/models/spree/address.rb
402
403
  - app/models/spree/adjustable/adjustments_updater.rb
@@ -444,6 +445,7 @@ files:
444
445
  - app/models/spree/order/payments.rb
445
446
  - app/models/spree/order_contents.rb
446
447
  - app/models/spree/order_inventory.rb
448
+ - app/models/spree/order_merger.rb
447
449
  - app/models/spree/order_updater.rb
448
450
  - app/models/spree/payment.rb
449
451
  - app/models/spree/payment/gateway_options.rb
@@ -570,6 +572,7 @@ files:
570
572
  - config/locales/en.yml
571
573
  - config/routes.rb
572
574
  - db/default/spree/countries.rb
575
+ - db/default/spree/default_reimbursement_type.rb
573
576
  - db/default/spree/roles.rb
574
577
  - db/default/spree/states.rb
575
578
  - db/default/spree/stores.rb
@@ -776,6 +779,10 @@ files:
776
779
  - db/migrate/20150128060325_remove_spree_configurations.rb
777
780
  - db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb
778
781
  - db/migrate/20150309161154_ensure_payments_have_numbers.rb
782
+ - db/migrate/20150515211137_fix_adjustment_order_id.rb
783
+ - db/migrate/20150522181728_add_deleted_at_to_friendly_id_slugs.rb
784
+ - db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb
785
+ - db/migrate/20150707204155_enable_acts_as_paranoid_on_calculators.rb
779
786
  - db/seeds.rb
780
787
  - lib/generators/spree/custom_user/custom_user_generator.rb
781
788
  - lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt