solidus_core 1.3.2 → 1.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_core might be problematic. Click here for more details.

Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -0
  3. data/app/helpers/spree/base_helper.rb +6 -2
  4. data/app/mailers/spree/base_mailer.rb +1 -1
  5. data/app/mailers/spree/carton_mailer.rb +1 -1
  6. data/app/mailers/spree/order_mailer.rb +2 -2
  7. data/app/mailers/spree/reimbursement_mailer.rb +7 -7
  8. data/app/mailers/spree/test_mailer.rb +3 -2
  9. data/app/models/concerns/spree/user_payment_source.rb +1 -1
  10. data/app/models/spree/address.rb +14 -4
  11. data/app/models/spree/adjustment.rb +11 -19
  12. data/app/models/spree/app_configuration.rb +23 -1
  13. data/app/models/spree/base.rb +9 -0
  14. data/app/models/spree/country.rb +2 -2
  15. data/app/models/spree/exchange.rb +1 -1
  16. data/app/models/spree/gateway.rb +1 -1
  17. data/app/models/spree/item_adjustments.rb +7 -0
  18. data/app/models/spree/line_item.rb +1 -13
  19. data/app/models/spree/order/checkout.rb +19 -16
  20. data/app/models/spree/order/payments.rb +0 -2
  21. data/app/models/spree/order.rb +7 -21
  22. data/app/models/spree/order_contents.rb +60 -4
  23. data/app/models/spree/order_merger.rb +2 -4
  24. data/app/models/spree/order_shipping.rb +1 -1
  25. data/app/models/spree/order_update_attributes.rb +0 -2
  26. data/app/models/spree/order_updater.rb +14 -11
  27. data/app/models/spree/payment.rb +2 -3
  28. data/app/models/spree/payment_create.rb +5 -2
  29. data/app/models/spree/payment_method/store_credit.rb +6 -5
  30. data/app/models/spree/product/scopes.rb +2 -1
  31. data/app/models/spree/product.rb +2 -5
  32. data/app/models/spree/promotion/actions/create_item_adjustments.rb +5 -3
  33. data/app/models/spree/promotion/actions/free_shipping.rb +1 -1
  34. data/app/models/spree/promotion/rules/option_value.rb +2 -3
  35. data/app/models/spree/promotion/rules/product.rb +9 -3
  36. data/app/models/spree/promotion/rules/taxon.rb +33 -7
  37. data/app/models/spree/promotion/rules/user.rb +2 -3
  38. data/app/models/spree/promotion.rb +16 -6
  39. data/app/models/spree/promotion_handler/coupon.rb +1 -1
  40. data/app/models/spree/shipment.rb +12 -16
  41. data/app/models/spree/stock/estimator.rb +1 -1
  42. data/app/models/spree/stock/package.rb +0 -1
  43. data/app/models/spree/stock_item.rb +2 -6
  44. data/app/models/spree/store.rb +2 -1
  45. data/app/models/spree/tax_rate.rb +1 -1
  46. data/app/models/spree/wallet/add_payment_sources_to_wallet.rb +29 -0
  47. data/app/models/spree/wallet/default_payment_builder.rb +26 -0
  48. data/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb +46 -0
  49. data/app/views/spree/reimbursement_mailer/reimbursement_email.text.erb +1 -1
  50. data/app/views/spree/shared/_base_mailer_footer.html.erb +1 -20
  51. data/app/views/spree/shared/_base_mailer_header.html.erb +1 -31
  52. data/config/initializers/spree_user.rb +1 -1
  53. data/config/locales/en.yml +58 -34
  54. data/db/migrate/20130414000512_update_name_fields_on_spree_credit_cards.rb +1 -1
  55. data/db/migrate/20140601011216_set_shipment_total_for_users_upgrading.rb +15 -3
  56. data/db/migrate/20160527070401_rename_shipment_address_field.rb +7 -0
  57. data/db/migrate/20160616232103_remove_user_id_from_promotion_rules.rb +11 -0
  58. data/db/migrate/20160718205341_add_payment_id_index_to_spree_refunds.rb +5 -0
  59. data/db/migrate/20160718205859_add_reimbursement_id_index_to_spree_refunds.rb +5 -0
  60. data/lib/generators/spree/dummy/dummy_generator.rb +1 -1
  61. data/lib/generators/spree/dummy/templates/rails/database.yml +3 -1
  62. data/lib/generators/spree/dummy/templates/rails/test.rb +4 -2
  63. data/lib/generators/spree/install/install_generator.rb +6 -16
  64. data/lib/spree/core/controller_helpers/auth.rb +1 -1
  65. data/lib/spree/core/controller_helpers/common.rb +1 -1
  66. data/lib/spree/core/controller_helpers/order.rb +2 -2
  67. data/lib/spree/core/current_store.rb +5 -1
  68. data/lib/spree/core/delegate_belongs_to.rb +1 -1
  69. data/lib/spree/core/routes.rb +6 -32
  70. data/lib/spree/core/search/base.rb +2 -2
  71. data/lib/spree/core/stock_configuration.rb +6 -0
  72. data/lib/spree/core/version.rb +2 -2
  73. data/lib/spree/core.rb +2 -1
  74. data/lib/spree/i18n.rb +7 -0
  75. data/lib/spree/mailer_previews/carton_preview.rb +2 -1
  76. data/lib/spree/mailer_previews/order_preview.rb +8 -3
  77. data/lib/spree/mailer_previews/reimbursement_preview.rb +11 -0
  78. data/lib/spree/migrations.rb +13 -7
  79. data/lib/spree/permitted_attributes.rb +1 -1
  80. data/lib/spree/testing_support/capybara_ext.rb +6 -1
  81. data/lib/spree/testing_support/common_rake.rb +3 -7
  82. data/lib/spree/testing_support/controller_requests.rb +8 -0
  83. data/lib/spree/testing_support/factories/order_factory.rb +30 -8
  84. data/lib/spree/testing_support/factories/payment_factory.rb +1 -1
  85. data/lib/spree/testing_support/factories/product_factory.rb +6 -0
  86. data/lib/spree/testing_support/factories/reimbursement_factory.rb +1 -0
  87. data/lib/tasks/migrations/copy_shipped_shipments_to_cartons.rake +3 -1
  88. data/solidus_core.gemspec +3 -3
  89. data/spec/helpers/base_helper_spec.rb +18 -2
  90. data/spec/lib/i18n_spec.rb +4 -0
  91. data/spec/lib/spree/core/controller_helpers/order_spec.rb +16 -4
  92. data/spec/lib/spree/core/controller_helpers/payment_parameters_spec.rb +75 -59
  93. data/spec/lib/spree/core/delegate_belongs_to_spec.rb +1 -1
  94. data/spec/lib/spree/core/importer/order_spec.rb +4 -2
  95. data/spec/lib/spree/core/stock_configuration_spec.rb +17 -0
  96. data/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb +195 -0
  97. data/spec/lib/spree/core/testing_support/factories/payment_factory_spec.rb +6 -0
  98. data/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb +6 -0
  99. data/spec/lib/spree/migrations_spec.rb +3 -9
  100. data/spec/lib/tasks/migrations/copy_shipped_shipments_to_cartons_spec.rb +1 -1
  101. data/spec/mailers/carton_mailer_spec.rb +1 -1
  102. data/spec/mailers/order_mailer_spec.rb +2 -2
  103. data/spec/mailers/reimbursement_mailer_spec.rb +1 -1
  104. data/spec/models/spree/address_spec.rb +22 -0
  105. data/spec/models/spree/adjustment_spec.rb +0 -10
  106. data/spec/models/spree/carton_spec.rb +1 -1
  107. data/spec/models/spree/country_spec.rb +9 -1
  108. data/spec/models/spree/gateway/bogus_spec.rb +1 -1
  109. data/spec/models/spree/item_adjustments_spec.rb +33 -0
  110. data/spec/models/spree/line_item_spec.rb +2 -21
  111. data/spec/models/spree/order/checkout_spec.rb +32 -45
  112. data/spec/models/spree/order/payment_spec.rb +1 -16
  113. data/spec/models/spree/order_cancellations_spec.rb +8 -3
  114. data/spec/models/spree/order_contents_spec.rb +48 -0
  115. data/spec/models/spree/order_merger_spec.rb +8 -5
  116. data/spec/models/spree/order_shipping_spec.rb +3 -4
  117. data/spec/models/spree/order_spec.rb +23 -59
  118. data/spec/models/spree/order_update_attributes_spec.rb +1 -5
  119. data/spec/models/spree/order_updater_spec.rb +39 -11
  120. data/spec/models/spree/payment_create_spec.rb +61 -0
  121. data/spec/models/spree/payment_method/store_credit_spec.rb +23 -10
  122. data/spec/models/spree/payment_spec.rb +17 -4
  123. data/spec/models/spree/product_spec.rb +1 -1
  124. data/spec/models/spree/promotion/actions/create_item_adjustments_spec.rb +8 -13
  125. data/spec/models/spree/promotion/rules/product_spec.rb +33 -0
  126. data/spec/models/spree/promotion/rules/taxon_spec.rb +52 -8
  127. data/spec/models/spree/promotion_spec.rb +18 -12
  128. data/spec/models/spree/return_authorization_spec.rb +0 -16
  129. data/spec/models/spree/shipment_spec.rb +57 -36
  130. data/spec/models/spree/stock/coordinator_spec.rb +0 -5
  131. data/spec/models/spree/stock/package_spec.rb +0 -1
  132. data/spec/models/spree/stock_item_spec.rb +35 -145
  133. data/spec/models/spree/store_spec.rb +24 -10
  134. data/spec/models/spree/tax_rate_spec.rb +2 -2
  135. data/spec/models/spree/user_spec.rb +1 -1
  136. data/spec/models/spree/validations/db_maximum_length_validator_spec.rb +20 -12
  137. data/spec/support/concerns/working_factories.rb +4 -0
  138. metadata +30 -10
  139. data/config/routes.rb +0 -1
@@ -15,7 +15,8 @@ module Spree
15
15
  scope :by_url, lambda { |url| where("url like ?", "%#{url}%") }
16
16
 
17
17
  def self.current(store_key = nil)
18
- current_store = Store.find_by(code: store_key) || Store.by_url(store_key).first
18
+ Spree::Deprecation.warn "Spree::Store.current needs a code or URL as an argument. If you want the default store use Spree::Store.default", caller if !store_key
19
+ current_store = Store.find_by(code: store_key) || Store.by_url(store_key).first if store_key
19
20
  current_store || Store.default
20
21
  end
21
22
 
@@ -72,7 +72,7 @@ module Spree
72
72
  # @param [Spree::Zone] order_tax_zone is the smalles applicable zone to the order's tax address
73
73
  # @param [Array<Spree::LineItem,Spree::Shipment>] items to be adjusted
74
74
  def self.adjust(order_tax_zone, items)
75
- ActiveSupport::Deprecation.warn("Please use Spree::Tax::OrderAdjuster or Spree::Tax::ItemAdjuster instead", caller)
75
+ Spree::Deprecation.warn("Please use Spree::Tax::OrderAdjuster or Spree::Tax::ItemAdjuster instead", caller)
76
76
  items.map do |item|
77
77
  Spree::Tax::ItemAdjuster.new(item, rates_for_order_zone: for_zone(order_tax_zone)).adjust!
78
78
  end
@@ -0,0 +1,29 @@
1
+ # This class is responsible for saving payment sources in the user's "wallet"
2
+ # for future use. You can substitute your own class via
3
+ # `Spree::Config.add_payment_sources_to_wallet_class`.
4
+ class Spree::Wallet::AddPaymentSourcesToWallet
5
+ def initialize(order)
6
+ @order = order
7
+ end
8
+
9
+ # This is called after an order transistions to complete and should save the
10
+ # order's payment source/s in the user's "wallet" for future use.
11
+ #
12
+ # @return [undefined]
13
+ def add_to_wallet
14
+ if !order.temporary_credit_card &&
15
+ order.user_id &&
16
+ order.valid_credit_cards.present?
17
+ # arbitrarily pick the first one for the default
18
+ default_cc = order.valid_credit_cards.first
19
+ # TODO: target for refactoring -- why is order checkout responsible for the user -> credit_card relationship?
20
+ default_cc.user_id = order.user_id
21
+ default_cc.default = true
22
+ default_cc.save
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ attr_reader :order
29
+ end
@@ -0,0 +1,26 @@
1
+ # This class is responsible for building a default payment on an order, using a
2
+ # payment source that is already in the user's "wallet".
3
+ class Spree::Wallet::DefaultPaymentBuilder
4
+ def initialize(order)
5
+ @order = order
6
+ end
7
+
8
+ # Build a payment to be added to an order prior to moving into the "payment"
9
+ # state.
10
+ #
11
+ # @return [Payment] the unsaved payment to be added, or nil if none.
12
+ def build
13
+ credit_card = order.user.try!(:default_credit_card)
14
+
15
+ if credit_card.try!(:valid?) && order.payments.from_credit_card.count == 0
16
+ Spree::Payment.new(
17
+ payment_method_id: credit_card.payment_method_id,
18
+ source: credit_card,
19
+ )
20
+ end
21
+ end
22
+
23
+ private
24
+
25
+ attr_reader :order
26
+ end
@@ -0,0 +1,46 @@
1
+ <table>
2
+ <tr>
3
+ <td>
4
+ <p class="lede">
5
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.dear_customer') %>
6
+ </p>
7
+ <p>
8
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.instructions') %>
9
+ </p>
10
+ <p>
11
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.refund_summary') %>
12
+ </p>
13
+ <p>
14
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.total_refunded', total: @reimbursement.display_total) %>
15
+ </p>
16
+ <% if @reimbursement.return_items.exchange_requested.present? %>
17
+ <p>
18
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.exchange_summary') %>
19
+ </p>
20
+ <table>
21
+ <% @reimbursement.return_items.exchange_requested.each do |return_item| %>
22
+ <tr>
23
+ <td>
24
+ <%= return_item.variant.sku %> <%= raw(return_item.variant.name) %> <%= "(#{raw(return_item.variant.options_text)})" if return_item.variant.options_text.present? %>
25
+ </td>
26
+ <td>
27
+ ->
28
+ </td>
29
+ <td>
30
+ <%= return_item.exchange_variant.sku %> <%= raw(return_item.exchange_variant.name) %> <%= "(#{raw(return_item.exchange_variant.options_text)})" if return_item.exchange_variant.options_text.present? %>
31
+ </td>
32
+ </tr>
33
+ <% end %>
34
+ <% if @reimbursement.return_items.awaiting_return.present? && Spree::Config[:expedited_exchanges] %>
35
+ <tr>
36
+ <td colspan="3">
37
+ <%= Spree.t('reimbursement_mailer.reimbursement_email.days_to_send', days: Spree::Config[:expedited_exchanges_days_window]) %>
38
+ </td>
39
+ </tr>
40
+ <% end %>
41
+ </table>
42
+ <% end %>
43
+ </td>
44
+ <td class="expander"></td>
45
+ </tr>
46
+ </table>
@@ -12,7 +12,7 @@
12
12
  <%= Spree.t('reimbursement_mailer.reimbursement_email.exchange_summary') %>
13
13
  ============================================================
14
14
  <% @reimbursement.return_items.exchange_requested.each do |return_item| %>
15
- <%= return_item.variant.sku %> <%= raw(return_item.variant.product.name) %> <%= "(#{raw(return_item.variant.options_text)})" if return_item.variant.options_text.present? -%> -> <%= return_item.exchange_variant.sku %> <%= raw(return_item.exchange_variant.product.name) if return_item.exchange_variant.options_text.present? %> <%= "(#{raw(return_item.exchange_variant.options_text)})" -%>
15
+ <%= return_item.variant.sku %> <%= raw(return_item.variant.name) %> <%= "(#{raw(return_item.variant.options_text)})" if return_item.variant.options_text.present? %> -> <%= return_item.exchange_variant.sku %> <%= raw(return_item.exchange_variant.name) %> <%= "(#{raw(return_item.exchange_variant.options_text)})" if return_item.exchange_variant.options_text.present? %>
16
16
  <% end %>
17
17
 
18
18
 
@@ -1,20 +1 @@
1
- <!-- You can override this template to design your own footer.
2
- <table class="row footer">
3
- <tr>
4
- <td class="wrapper last">
5
-
6
- <table class="twelve columns">
7
- <tr>
8
- <td align="center">
9
- <center>
10
- <p style="text-align:center;"><a href="#">Terms</a> | <a href="#">Privacy</a> | <a href="#">Unsubscribe</a></p>
11
- </center>
12
- </td>
13
- <td class="expander"></td>
14
- </tr>
15
- </table>
16
-
17
- </td>
18
- </tr>
19
- </table>
20
- -->
1
+ <!-- You can override this template to design your own footer. -->
@@ -1,31 +1 @@
1
- <!-- You can override this template to design your own header.
2
- <table class="row header">
3
- <tr>
4
- <td class="center" align="center">
5
- <center>
6
-
7
- <table class="container">
8
- <tr>
9
- <td class="wrapper last">
10
-
11
- <table class="twelve columns">
12
- <tr>
13
- <td class="six sub-columns">
14
- <%= image_tag(Spree::Config.logo) %>
15
- </td>
16
- <td class="six sub-columns last" style="text-align:right; vertical-align:middle;">
17
- <span class="template-label"><%= Spree::Store.current.name %></span>
18
- </td>
19
- <td class="expander"></td>
20
- </tr>
21
- </table>
22
-
23
- </td>
24
- </tr>
25
- </table>
26
-
27
- </center>
28
- </td>
29
- </tr>
30
- </table>
31
- -->
1
+ <!-- You can override this template to design your own header. -->
@@ -4,7 +4,7 @@
4
4
 
5
5
  Spree::Core::Engine.config.to_prepare do
6
6
  if Spree.user_class && !Spree.user_class.included_modules.include?(Spree::UserMethods)
7
- ActiveSupport::Deprecation.warn "#{Spree.user_class} must include Spree::UserMethods"
7
+ Spree::Deprecation.warn "#{Spree.user_class} must include Spree::UserMethods"
8
8
  Spree.user_class.include Spree::UserMethods
9
9
  end
10
10
  end
@@ -345,6 +345,10 @@ en:
345
345
  name: Name
346
346
  default_tax: Default Tax Zone
347
347
  models:
348
+ # LegacyUser maps to this model_name so we want to provide translations for it
349
+ user:
350
+ one: User
351
+ other: Users
348
352
  spree/address:
349
353
  one: Address
350
354
  other: Addresses
@@ -369,6 +373,9 @@ en:
369
373
  spree/exchange:
370
374
  one: Exchange
371
375
  other: Exchanges
376
+ spree/image:
377
+ one: Image
378
+ other: Images
372
379
  spree/inventory_unit:
373
380
  one: Inventory Unit
374
381
  other: Inventory Units
@@ -415,8 +422,8 @@ en:
415
422
  one: Promotion Category
416
423
  other: Promotion Categories
417
424
  spree/property:
418
- one: Property
419
- other: Properties
425
+ one: Property Type
426
+ other: Property Types
420
427
  spree/prototype:
421
428
  one: Prototype
422
429
  other: Prototypes
@@ -436,8 +443,8 @@ en:
436
443
  one: Return Authorization
437
444
  other: Return Authorizations
438
445
  spree/return_reason:
439
- one: Return Reason
440
- other: Return Reasons
446
+ one: RMA Reason
447
+ other: RMA Reasons
441
448
  spree/role:
442
449
  one: Roles
443
450
  other: Roles
@@ -466,6 +473,9 @@ en:
466
473
  spree/stock_transfer:
467
474
  one: Stock Transfer
468
475
  other: Stock Transfers
476
+ spree/store_credit:
477
+ one: Store Credit
478
+ other: Store Credits
469
479
  spree/store_credit_category:
470
480
  one: Category
471
481
  other: Categories
@@ -688,10 +698,11 @@ en:
688
698
  adjustments: Adjustments
689
699
  admin:
690
700
  tab:
691
- areas: Areas
692
- checkout: Checkout
701
+ areas: Locations
702
+ checkout: Refunds and Returns
693
703
  configuration: Configuration
694
- general: General
704
+ display_order: Display Order
705
+ general: Store
695
706
  option_types: Option Types
696
707
  orders: Orders
697
708
  overview: Overview
@@ -699,15 +710,15 @@ en:
699
710
  products: Products
700
711
  promotions: Promotions
701
712
  promotion_categories: Promotion Categories
702
- properties: Properties
713
+ properties: Property Types
703
714
  prototypes: Prototypes
704
715
  reports: Reports
705
716
  rma: RMA
706
717
  settings: Settings
707
718
  shipping: Shipping
708
719
  stock: Stock
709
- stock_items: Management
710
- stock_transfers: Transfers
720
+ stock_items: Store Stock
721
+ stock_transfers: Stock Transfers
711
722
  taxes: Taxes
712
723
  taxonomies: Taxonomies
713
724
  taxons: Taxons
@@ -762,8 +773,10 @@ en:
762
773
  amount_authorized_exceeds_total_credit: " exceeds the available credit"
763
774
  amount_used_not_zero: "is greater than zero. Can not delete store credit"
764
775
  update_reason_required: "A reason for the change must be selected"
776
+ taxons:
777
+ display_order: Display Order
765
778
  variants:
766
- index:
779
+ table_filter:
767
780
  show_deleted: Show deleted variants
768
781
  new:
769
782
  new_variant: New variant
@@ -804,6 +817,7 @@ en:
804
817
  analytics_desc_list_4: It's completely free!
805
818
  analytics_trackers: Analytics Trackers
806
819
  and: and
820
+ apply_code: Apply Code
807
821
  approve: approve
808
822
  approver: Approver
809
823
  approved_at: Approved at
@@ -834,12 +848,12 @@ en:
834
848
  back_to_products_list: Back To Products List
835
849
  back_to_promotions_list: Back To Promotions List
836
850
  back_to_promotion_categories_list: Back To Promotions Categories List
837
- back_to_properties_list: Back To Properties List
851
+ back_to_properties_list: Back To Property Types List
838
852
  back_to_prototypes_list: Back To Prototypes List
839
853
  back_to_reports_list: Back To Reports List
840
854
  back_to_refund_reason_list: Back To Refund Reason List
841
855
  back_to_reimbursement_type_list: Back To Reimbursement Type List
842
- back_to_return_authorizations_list: Back To Return Authorizations List
856
+ back_to_return_authorizations_list: Back To RMA List
843
857
  back_to_rma_reason_list: Back To RMA Reason List
844
858
  back_to_shipping_categories: Back To Shipping Categories
845
859
  back_to_shipping_categories_list: Back To Shipping Categories List
@@ -870,7 +884,7 @@ en:
870
884
  calculator: Calculator
871
885
  calculator_settings_warning: If you are changing the calculator type or preference source, you must save first before you can edit the calculator settings
872
886
  cancel: cancel
873
- cancel_inventory: 'Cancel Inventory'
887
+ cancel_inventory: 'Cancel Items'
874
888
  canceled: canceled
875
889
  canceled_at: Canceled at
876
890
  canceler: Canceler
@@ -1021,7 +1035,7 @@ en:
1021
1035
  editing_product: Editing Product
1022
1036
  editing_promotion: Editing Promotion
1023
1037
  editing_promotion_category: Editing Promotion Category
1024
- editing_property: Editing Property
1038
+ editing_property: Editing Property Type
1025
1039
  editing_prototype: Editing Prototype
1026
1040
  edit_refund_reason: Edit Refund Reason
1027
1041
  editing_refund: Editing Refund
@@ -1097,6 +1111,15 @@ en:
1097
1111
  expiration: Expiration
1098
1112
  extension: Extension
1099
1113
  existing_shipments: Existing shipments
1114
+ hints:
1115
+ spree/price:
1116
+ country: "This determines in what country the price is valid.<br/>Default: Any Country"
1117
+ spree/product:
1118
+ promotionable: "This determines whether or not promotions can apply to this product.<br/>Default: Checked"
1119
+ shipping_category: "This determines what kind of shipping this product requires.<br/> Default: Default"
1120
+ tax_category: "This determines what kind of taxation is applied to this product.<br/> Default: None"
1121
+ spree/variant:
1122
+ tax_category: "This determines what kind of taxation is applied to this variant.<br/> Default: Use tax category of the product associated with this variant"
1100
1123
  failed_payment_attempts: Failed Payment Attempts
1101
1124
  failure: Failure
1102
1125
  filename: Filename
@@ -1125,7 +1148,7 @@ en:
1125
1148
  gateway_config_unavailable: Gateway unavailable for environment
1126
1149
  gateway_error: Gateway Error
1127
1150
  general: General
1128
- general_settings: General Settings
1151
+ general_settings: Store
1129
1152
  google_analytics: Google Analytics
1130
1153
  google_analytics_id: Analytics ID
1131
1154
  group_size: Group size
@@ -1202,7 +1225,7 @@ en:
1202
1225
  gt: greater than
1203
1226
  gte: greater than or equal to
1204
1227
  items_cannot_be_shipped: We are unable to calculate shipping rates for the selected items.
1205
- items_in_rmas: Items in Return Authorizations
1228
+ items_in_rmas: Items in RMA's (Return Merchandise Authorizations)
1206
1229
  items_to_be_reimbursed: Items to be reimbursed
1207
1230
  items_reimbursed: Items reimbursed
1208
1231
  jirafe: Jirafe
@@ -1214,12 +1237,12 @@ en:
1214
1237
  lifetime_stats: Lifetime Stats
1215
1238
  line_item_adjustments: "Line item adjustments"
1216
1239
  list: List
1217
- listing_countries: Listing Countries
1218
- listing_orders: Listing Orders
1219
- listing_products: Listing Products
1220
- listing_reports: Listing Reports
1221
- listing_tax_categories: Listing Tax Categories
1222
- listing_users: Listing Users
1240
+ listing_countries: Countries
1241
+ listing_orders: Orders
1242
+ listing_products: Products
1243
+ listing_reports: Reports
1244
+ listing_tax_categories: Tax Categories
1245
+ listing_users: Users
1223
1246
  loading: Loading
1224
1247
  locale_changed: Locale Changed
1225
1248
  location: Location
@@ -1238,7 +1261,7 @@ en:
1238
1261
  make_refund: Make refund
1239
1262
  make_sure_the_above_reimbursement_amount_is_correct: Make sure the above reimbursement amount is correct
1240
1263
  manage_promotion_categories: Manage Promotion Categories
1241
- manage_stock: Manage Stock
1264
+ manage_stock: Store Stock
1242
1265
  manual_intervention_required: Manual intervention required
1243
1266
  manage_variants: Manage Variants
1244
1267
  master_price: Master Price
@@ -1277,12 +1300,12 @@ en:
1277
1300
  new_product: New Product
1278
1301
  new_promotion: New Promotion
1279
1302
  new_promotion_category: New Promotion Category
1280
- new_property: New Property
1303
+ new_property: New Property Type
1281
1304
  new_prototype: New Prototype
1282
1305
  new_refund: New Refund
1283
1306
  new_refund_reason: New Refund Reason
1284
1307
  new_rma_reason: New RMA Reason
1285
- new_return_authorization: New Return Authorization
1308
+ new_return_authorization: New RMA
1286
1309
  new_shipping_category: New Shipping Category
1287
1310
  new_shipping_method: New Shipping Method
1288
1311
  new_shipment_at_location: New shipment at location
@@ -1290,11 +1313,12 @@ en:
1290
1313
  new_stock_location: New Stock Location
1291
1314
  new_stock_movement: New Stock Movement
1292
1315
  new_stock_transfer: New Stock Transfer
1316
+ new_store_credit: New Store Credit
1293
1317
  new_tax_category: New Tax Category
1294
1318
  new_tax_rate: New Tax Rate
1295
1319
  new_taxon: New Taxon
1296
1320
  new_taxonomy: New Taxonomy
1297
- new_tracker: New Tracker
1321
+ new_tracker: New Analytics Tracker
1298
1322
  new_user: New User
1299
1323
  new_variant: New Variant
1300
1324
  new_zone: New Zone
@@ -1546,8 +1570,8 @@ en:
1546
1570
  promotion_total_changed_before_complete: "One or more of the promotions on your order have become ineligible and were removed. Please check the new order amounts and try again."
1547
1571
  promotion_uses: Promotion uses
1548
1572
  propagate_all_variants: Propagate all variants
1549
- properties: Properties
1550
- property: Property
1573
+ properties: Property Types
1574
+ property: Property Type
1551
1575
  prototype: Prototype
1552
1576
  prototypes: Prototypes
1553
1577
  provider: Provider
@@ -1598,10 +1622,9 @@ en:
1598
1622
  resume: resume
1599
1623
  resumed: Resumed
1600
1624
  return: return
1601
- return_authorization: Return Authorization
1602
- return_reasons: Return Reasons
1603
- return_authorization_updated: Return authorization updated
1604
- return_authorizations: Return Authorizations
1625
+ return_authorization: Return Merchandise Authorization
1626
+ return_authorizations: Return Merchandise Authorizations
1627
+ return_authorization_updated: Return merchandise authorization updated
1605
1628
  return_item_inventory_unit_ineligible: Return item's inventory unit must be shipped
1606
1629
  return_item_inventory_unit_reimbursed: Return item's inventory unit is already reimbursed
1607
1630
  return_item_order_not_completed: Return item's order must be completed
@@ -1622,6 +1645,7 @@ en:
1622
1645
  total_refunded: ! 'Total refunded: %{total}'
1623
1646
  return_number: Return Number
1624
1647
  return_quantity: Return Quantity
1648
+ return_reasons: Return Reasons
1625
1649
  returned: Returned
1626
1650
  review: Review
1627
1651
  risk: Risk
@@ -1741,7 +1765,7 @@ en:
1741
1765
  stock_location_info: Stock location info
1742
1766
  stock_locations: Stock Locations
1743
1767
  stock_locations_need_a_default_country: You must create a default country before creating a stock location.
1744
- stock_management: Stock Management
1768
+ stock_management: Product Stock
1745
1769
  stock_management_requires_a_stock_location: Please create a stock location in order to manage stock.
1746
1770
  stock_movements: Stock Movements
1747
1771
  stock_movements_for_stock_location: Stock Movements for %{stock_location_name}
@@ -1,7 +1,7 @@
1
1
  class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration
2
2
  def up
3
3
  if ActiveRecord::Base.connection.adapter_name.downcase.include? "mysql"
4
- execute "UPDATE spree_credit_cards SET name = CONCAT(first_name, ' ', last_name)"
4
+ execute "UPDATE spree_credit_cards SET name = CONCAT_WS(' ', first_name, last_name)"
5
5
  else
6
6
  execute "UPDATE spree_credit_cards SET name = first_name || ' ' || last_name"
7
7
  end
@@ -3,8 +3,20 @@ class SetShipmentTotalForUsersUpgrading < ActiveRecord::Migration
3
3
  # NOTE You might not need this at all unless you're upgrading from Spree 2.1.x
4
4
  # or below. For those upgrading this should populate the Order#shipment_total
5
5
  # for legacy orders
6
- Spree::Order.complete.where('shipment_total = ?', 0).includes(:shipments).find_each do |order|
7
- order.update_column(:shipment_total, order.shipments.sum(:cost))
8
- end
6
+ execute <<-EOS.squish
7
+ UPDATE spree_orders
8
+ SET shipment_total =
9
+ COALESCE(
10
+ (
11
+ SELECT SUM(spree_shipments.cost)
12
+ FROM spree_shipments
13
+ WHERE spree_shipments.order_id = spree_orders.id
14
+ ),
15
+ 0
16
+ )
17
+ WHERE
18
+ spree_orders.completed_at IS NOT NULL
19
+ AND spree_orders.shipment_total = 0
20
+ EOS
9
21
  end
10
22
  end
@@ -0,0 +1,7 @@
1
+ class RenameShipmentAddressField < ActiveRecord::Migration
2
+ def change
3
+ change_table :spree_shipments do |t|
4
+ t.rename :address_id, :deprecated_address_id
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ class RemoveUserIdFromPromotionRules < ActiveRecord::Migration
2
+ def up
3
+ remove_index :spree_promotion_rules, name: 'index_promotion_rules_on_user_id'
4
+ remove_column :spree_promotion_rules, :user_id
5
+ end
6
+
7
+ def down
8
+ add_column :spree_promotion_rules, :user_id, :integer
9
+ add_index :spree_promotion_rules, [:user_id], name: 'index_promotion_rules_on_user_id'
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddPaymentIdIndexToSpreeRefunds < ActiveRecord::Migration
2
+ def change
3
+ add_index(:spree_refunds, :payment_id)
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddReimbursementIdIndexToSpreeRefunds < ActiveRecord::Migration
2
+ def change
3
+ add_index(:spree_refunds, :reimbursement_id)
4
+ end
5
+ end
@@ -124,7 +124,7 @@ end
124
124
  core_gems = ["spree/core", "spree/api", "spree/backend", "spree/frontend"]
125
125
 
126
126
  if core_gems.include?(lib_name)
127
- '../../../../Gemfile'
127
+ '../../../../../Gemfile'
128
128
  else
129
129
  '../../../../Gemfile'
130
130
  end
@@ -52,7 +52,7 @@ production:
52
52
  <% unless db_host.blank? %>
53
53
  host: <%= db_host %>
54
54
  <% end %>
55
- <% else %>
55
+ <% when 'sqlite', '', nil %>
56
56
  development:
57
57
  adapter: sqlite3
58
58
  database: db/spree_development.sqlite3
@@ -62,4 +62,6 @@ test:
62
62
  production:
63
63
  adapter: sqlite3
64
64
  database: db/spree_production.sqlite3
65
+ <% else %>
66
+ <% raise "Invalid DB specified: #{ENV['DB']}" %>
65
67
  <% end %>
@@ -29,6 +29,8 @@ Dummy::Application.configure do
29
29
  config.action_mailer.delivery_method = :test
30
30
  ActionMailer::Base.default :from => "spree@example.com"
31
31
 
32
- # Print deprecation notices to the stderr
33
- config.active_support.deprecation = :stderr
32
+ # Raise on deprecation warnings
33
+ if ENV['SOLIDUS_RAISE_DEPRECATIONS'].present?
34
+ Spree::Deprecation.behavior = :raise
35
+ end
34
36
  end
@@ -108,24 +108,19 @@ Spree::Auth::Engine.load_seed if defined?(Spree::Auth)
108
108
 
109
109
  def install_migrations
110
110
  say_status :copying, "migrations"
111
- silence_stream(STDOUT) do
112
- silence_warnings { rake 'railties:install:migrations' }
113
- end
111
+ `rake railties:install:migrations`
114
112
  end
115
113
 
116
114
  def create_database
117
115
  say_status :creating, "database"
118
- silence_stream(STDOUT) do
119
- silence_stream(STDERR) do
120
- silence_warnings { rake 'db:create' }
121
- end
122
- end
116
+ rake 'db:create'
123
117
  end
124
118
 
125
119
  def run_migrations
126
120
  if @run_migrations
127
121
  say_status :running, "migrations"
128
- quietly { rake 'db:migrate' }
122
+
123
+ rake 'db:migrate VERBOSE=false'
129
124
  else
130
125
  say_status :skipping, "migrations (don't forget to run rake db:migrate)"
131
126
  end
@@ -139,12 +134,7 @@ Spree::Auth::Engine.load_seed if defined?(Spree::Auth)
139
134
  rake_options << "ADMIN_EMAIL=#{options[:admin_email]}" if options[:admin_email]
140
135
  rake_options << "ADMIN_PASSWORD=#{options[:admin_password]}" if options[:admin_password]
141
136
 
142
- cmd = lambda { rake("db:seed #{rake_options.join(' ')}") }
143
- if options[:auto_accept] || (options[:admin_email] && options[:admin_password])
144
- quietly(&cmd)
145
- else
146
- cmd.call
147
- end
137
+ rake("db:seed #{rake_options.join(' ')}")
148
138
  else
149
139
  say_status :skipping, "seed data (you can always run rake db:seed)"
150
140
  end
@@ -153,7 +143,7 @@ Spree::Auth::Engine.load_seed if defined?(Spree::Auth)
153
143
  def load_sample_data
154
144
  if @load_sample_data
155
145
  say_status :loading, "sample data"
156
- quietly { rake 'spree_sample:load' }
146
+ rake 'spree_sample:load'
157
147
  else
158
148
  say_status :skipping, "sample data (you can always run rake spree_sample:load)"
159
149
  end
@@ -12,7 +12,7 @@ module Spree
12
12
  # @return [Proc] action to take when access denied error is raised.
13
13
 
14
14
  included do
15
- before_filter :set_guest_token
15
+ before_action :set_guest_token
16
16
  helper_method :try_spree_current_user
17
17
 
18
18
  class_attribute :unauthorized_redirect
@@ -10,7 +10,7 @@ module Spree
10
10
 
11
11
  layout :get_layout
12
12
 
13
- before_filter :set_user_language
13
+ before_action :set_user_language
14
14
  end
15
15
 
16
16
  protected