solidus_core 2.8.6 → 2.9.0.rc.1
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.
- checksums.yaml +4 -4
- data/app/assets/images/logo/solidus.svg +1 -18
- data/app/assets/images/logo/solidus_logo.png +0 -0
- data/app/mailers/spree/test_mailer.rb +2 -0
- data/app/models/concerns/spree/default_price.rb +1 -1
- data/app/models/concerns/spree/ransackable_attributes.rb +1 -1
- data/app/models/concerns/spree/user_reporting.rb +1 -1
- data/app/models/spree/billing_integration.rb +7 -2
- data/app/models/spree/country.rb +2 -0
- data/app/models/spree/customer_return.rb +1 -1
- data/app/models/spree/image.rb +2 -44
- data/app/models/spree/image/paperclip_attachment.rb +55 -0
- data/app/models/spree/inventory_unit.rb +0 -1
- data/app/models/spree/option_type.rb +2 -0
- data/app/models/spree/option_value.rb +1 -1
- data/app/models/spree/order.rb +8 -13
- data/app/models/spree/payment.rb +1 -1
- data/app/models/spree/payment_method.rb +8 -4
- data/app/models/spree/product.rb +1 -1
- data/app/models/spree/promotion.rb +18 -11
- data/app/models/spree/promotion/rules/first_order.rb +1 -3
- data/app/models/spree/promotion/rules/item_total.rb +9 -1
- data/app/models/spree/promotion/rules/one_use_per_user.rb +2 -2
- data/app/models/spree/promotion/rules/product.rb +3 -3
- data/app/models/spree/promotion/rules/taxon.rb +5 -8
- data/app/models/spree/promotion/rules/user_logged_in.rb +1 -1
- data/app/models/spree/promotion_handler/coupon.rb +19 -3
- data/app/models/spree/property.rb +2 -0
- data/app/models/spree/reimbursement.rb +5 -5
- data/app/models/spree/return_item.rb +6 -2
- data/app/models/spree/state.rb +6 -0
- data/app/models/spree/stock/location_filter/active.rb +14 -0
- data/app/models/spree/stock/location_filter/base.rb +43 -0
- data/app/models/spree/stock/simple_coordinator.rb +4 -1
- data/app/models/spree/stock_location.rb +2 -0
- data/app/models/spree/tax_category.rb +11 -0
- data/app/models/spree/taxon.rb +4 -11
- data/app/models/spree/taxon/paperclip_attachment.rb +21 -0
- data/app/models/spree/taxonomy.rb +2 -0
- data/app/models/spree/unit_cancel.rb +12 -1
- data/app/models/spree/variant.rb +1 -1
- data/app/models/spree/variant/pricing_options.rb +10 -0
- data/app/models/spree/wallet_payment_source.rb +26 -10
- data/app/models/spree/zone.rb +1 -1
- data/app/views/spree/order_mailer/inventory_cancellation_email.text.erb +3 -3
- data/config/locales/en.yml +26 -53
- data/db/default/spree/store_credit.rb +1 -0
- data/db/migrate/20161123154034_add_available_to_users_and_remove_display_on_from_shipping_methods.rb +1 -1
- data/db/migrate/20170608074534_rename_bogus_gateways.rb +9 -8
- data/db/migrate/20190220093635_drop_spree_store_credit_update_reasons.rb +19 -0
- data/lib/generators/spree/install/install_generator.rb +0 -3
- data/lib/generators/spree/install/templates/config/initializers/spree.rb.tt +3 -0
- data/lib/solidus/migrations/rename_gateways.rb +2 -0
- data/lib/spree/app_configuration.rb +24 -0
- data/lib/spree/core.rb +1 -0
- data/lib/spree/core/controller_helpers/pricing.rb +1 -4
- data/lib/spree/core/controller_helpers/strong_parameters.rb +7 -21
- data/lib/spree/core/engine.rb +5 -0
- data/lib/spree/core/importer/order.rb +1 -3
- data/lib/spree/core/stock_configuration.rb +5 -0
- data/lib/spree/core/version.rb +3 -1
- data/lib/spree/deprecation.rb +50 -0
- data/lib/spree/event.rb +111 -0
- data/lib/spree/event/adapters/active_support_notifications.rb +35 -0
- data/lib/spree/event/configuration.rb +17 -0
- data/lib/spree/event/processors/mailer_processor.rb +27 -0
- data/lib/spree/event/subscriber.rb +84 -0
- data/lib/spree/permitted_attributes.rb +7 -76
- data/lib/spree/testing_support/capybara_ext.rb +15 -0
- data/lib/spree/testing_support/common_rake.rb +1 -1
- data/lib/spree/testing_support/dummy_app.rb +3 -10
- data/lib/spree/testing_support/factories/promotion_factory.rb +10 -0
- data/lib/spree/testing_support/factories/return_item_factory.rb +1 -0
- data/lib/spree/testing_support/preferences.rb +62 -0
- data/lib/tasks/email.rake +2 -0
- data/lib/tasks/migrations/copy_order_bill_address_to_credit_card.rake +4 -0
- data/lib/tasks/migrations/migrate_shipping_rate_taxes.rake +2 -0
- data/lib/tasks/migrations/migrate_user_addresses.rake +3 -0
- data/lib/tasks/migrations/rename_gateways.rake +2 -0
- data/lib/tasks/order_capturing.rake +2 -0
- data/spec/helpers/base_helper_spec.rb +3 -3
- data/spec/helpers/products_helper_spec.rb +2 -2
- data/spec/{models → lib}/spree/app_configuration_spec.rb +11 -1
- data/spec/lib/spree/core/controller_helpers/pricing_spec.rb +13 -0
- data/spec/lib/spree/core/controller_helpers/strong_parameters_spec.rb +1 -8
- data/spec/lib/spree/core/testing_support/factories/shipping_method_factory_spec.rb +1 -1
- data/spec/lib/spree/core/testing_support/preferences_spec.rb +33 -0
- data/spec/lib/spree/event/subscriber_spec.rb +85 -0
- data/spec/lib/spree/event_spec.rb +92 -0
- data/spec/lib/spree/money_spec.rb +3 -9
- data/spec/lib/tasks/migrations/migrate_shipping_rate_taxes_spec.rb +5 -3
- data/spec/mailers/order_mailer_spec.rb +1 -1
- data/spec/mailers/test_mailer_spec.rb +3 -1
- data/spec/models/spree/address_spec.rb +5 -4
- data/spec/models/spree/concerns/user_address_book_spec.rb +4 -4
- data/spec/models/spree/country_spec.rb +5 -5
- data/spec/models/spree/customer_return_spec.rb +1 -1
- data/spec/models/spree/order/checkout_spec.rb +3 -7
- data/spec/models/spree/order/finalizing_spec.rb +1 -1
- data/spec/models/spree/order/payment_spec.rb +3 -3
- data/spec/models/spree/order_inventory_spec.rb +1 -1
- data/spec/models/spree/order_spec.rb +67 -2
- data/spec/models/spree/order_updater_spec.rb +2 -2
- data/spec/models/spree/payment_spec.rb +12 -0
- data/spec/models/spree/product_spec.rb +3 -3
- data/spec/models/spree/promotion/rules/first_order_spec.rb +13 -3
- data/spec/models/spree/promotion/rules/item_total_spec.rb +15 -0
- data/spec/models/spree/promotion/rules/one_use_per_user_spec.rb +10 -0
- data/spec/models/spree/promotion/rules/product_spec.rb +15 -0
- data/spec/models/spree/promotion/rules/taxon_spec.rb +59 -8
- data/spec/models/spree/promotion/rules/user_logged_in_spec.rb +5 -0
- data/spec/models/spree/promotion_handler/shipping_spec.rb +1 -1
- data/spec/models/spree/promotion_spec.rb +80 -0
- data/spec/models/spree/reimbursement_spec.rb +3 -2
- data/spec/models/spree/return_item_spec.rb +9 -0
- data/spec/models/spree/shipment_spec.rb +3 -3
- data/spec/models/spree/stock/availability_spec.rb +1 -1
- data/spec/models/spree/stock/estimator_spec.rb +5 -7
- data/spec/models/spree/stock/location_filter/active_spec.rb +22 -0
- data/spec/models/spree/stock/location_sorter/default_first_spec.rb +4 -2
- data/spec/models/spree/stock/location_sorter/unsorted_spec.rb +3 -1
- data/spec/models/spree/stock/quantifier_spec.rb +1 -1
- data/spec/models/spree/stock/simple_coordinator_spec.rb +5 -0
- data/spec/models/spree/stock_item_spec.rb +3 -2
- data/spec/models/spree/stock_movement_spec.rb +1 -1
- data/spec/models/spree/store_credit_spec.rb +1 -1
- data/spec/models/spree/tax/order_adjuster_spec.rb +1 -1
- data/spec/models/spree/tax/taxation_integration_spec.rb +1 -1
- data/spec/models/spree/tax_category_spec.rb +21 -0
- data/spec/models/spree/taxon_spec.rb +28 -0
- data/spec/models/spree/unit_cancel_spec.rb +41 -0
- data/spec/models/spree/user_spec.rb +3 -3
- data/spec/models/spree/variant/pricing_options_spec.rb +23 -0
- data/spec/models/spree/variant/vat_price_generator_spec.rb +1 -1
- data/spec/models/spree/variant_spec.rb +11 -8
- data/spec/models/spree/wallet_payment_source_spec.rb +35 -6
- data/spec/models/spree/wallet_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -4
- data/spec/support/concerns/default_price.rb +8 -0
- metadata +18 -5
- data/spec/lib/spree/permitted_attributes_spec.rb +0 -41
data/app/models/spree/zone.rb
CHANGED
@@ -42,7 +42,7 @@ module Spree
|
|
42
42
|
alias :members :zone_members
|
43
43
|
accepts_nested_attributes_for :zone_members, allow_destroy: true, reject_if: proc { |a| a['zoneable_id'].blank? }
|
44
44
|
|
45
|
-
self.whitelisted_ransackable_attributes = [
|
45
|
+
self.whitelisted_ransackable_attributes = %w[name description]
|
46
46
|
|
47
47
|
# Returns all zones that contain any of the zone members of the zone passed
|
48
48
|
# in. This also includes any country zones that contain the state of the
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<%= t('order_mailer.inventory_cancellation.dear_customer') %>
|
1
|
+
<%= t('spree.order_mailer.inventory_cancellation.dear_customer') %>
|
2
2
|
|
3
|
-
<%= t('order_mailer.inventory_cancellation.instructions') %>
|
3
|
+
<%= t('spree.order_mailer.inventory_cancellation.instructions') %>
|
4
4
|
|
5
5
|
============================================================
|
6
|
-
<%= t('order_mailer.inventory_cancellation.order_summary_canceled') %>
|
6
|
+
<%= t('spree.order_mailer.inventory_cancellation.order_summary_canceled') %>
|
7
7
|
============================================================
|
8
8
|
<% @inventory_units.each do |item| %>
|
9
9
|
<%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%>
|
data/config/locales/en.yml
CHANGED
@@ -97,6 +97,7 @@ en:
|
|
97
97
|
total: Total price
|
98
98
|
spree/log_entry:
|
99
99
|
details: Message
|
100
|
+
created_at: Date/Time
|
100
101
|
spree/option_type:
|
101
102
|
name: Name
|
102
103
|
presentation: Presentation
|
@@ -147,6 +148,9 @@ en:
|
|
147
148
|
number: Identifier
|
148
149
|
response_code: Transaction ID
|
149
150
|
state: State
|
151
|
+
spree/payment_capture_event:
|
152
|
+
created_at: Date/Time
|
153
|
+
amount: Amount
|
150
154
|
spree/payment_method:
|
151
155
|
active: Active
|
152
156
|
auto_capture: Auto Capture
|
@@ -318,7 +322,6 @@ en:
|
|
318
322
|
country_id: Country
|
319
323
|
default: Default
|
320
324
|
fulfillable: Fulfillable
|
321
|
-
internal_name: Internal Name
|
322
325
|
name: Name
|
323
326
|
phone: Phone
|
324
327
|
propagate_all_variants: Propagate All Variants
|
@@ -332,6 +335,7 @@ en:
|
|
332
335
|
spree/store:
|
333
336
|
available_locales: Locales Available in the Storefront
|
334
337
|
cart_tax_country_iso: Tax Country for Empty Carts
|
338
|
+
code: Slug
|
335
339
|
default: Default
|
336
340
|
default_currency: Default Currency
|
337
341
|
mail_from_address: Mail From Address
|
@@ -487,7 +491,10 @@ en:
|
|
487
491
|
spree/wallet_payment_source:
|
488
492
|
attributes:
|
489
493
|
payment_source:
|
490
|
-
has_to_be_payment_source_class:
|
494
|
+
has_to_be_payment_source_class: is not a valid payment source
|
495
|
+
not_owned_by_user: does not belong to the user associated with the order
|
496
|
+
user_id:
|
497
|
+
payment_source_already_exists: already has this payment source in their wallet
|
491
498
|
models:
|
492
499
|
spree/address:
|
493
500
|
one: Address
|
@@ -723,49 +730,6 @@ en:
|
|
723
730
|
user:
|
724
731
|
one: User
|
725
732
|
other: Users
|
726
|
-
devise:
|
727
|
-
confirmations:
|
728
|
-
confirmed: Your account was successfully confirmed. You are now signed in.
|
729
|
-
send_instructions: You will receive an email with instructions about how to
|
730
|
-
confirm your account in a few minutes.
|
731
|
-
failure:
|
732
|
-
inactive: Your account was not activated yet.
|
733
|
-
invalid: Invalid email or password.
|
734
|
-
invalid_token: Invalid authentication token.
|
735
|
-
locked: Your account is locked.
|
736
|
-
timeout: Your session expired, please sign in again to continue.
|
737
|
-
unauthenticated: You need to sign in or sign up before continuing.
|
738
|
-
unconfirmed: You have to confirm your account before continuing.
|
739
|
-
mailer:
|
740
|
-
confirmation_instructions:
|
741
|
-
subject: Confirmation Instructions
|
742
|
-
reset_password_instructions:
|
743
|
-
subject: Reset Password Instructions
|
744
|
-
unlock_instructions:
|
745
|
-
subject: Unlock Instructions
|
746
|
-
oauth_callbacks:
|
747
|
-
failure: Could not authorize you from %{kind} because %{reason}.
|
748
|
-
success: Successfully authorized from %{kind} account.
|
749
|
-
unlocks:
|
750
|
-
send_instructions: You will receive an email with instructions about how to
|
751
|
-
unlock your account in a few minutes.
|
752
|
-
unlocked: Your account was successfully unlocked. You are now signed in.
|
753
|
-
user_passwords:
|
754
|
-
user:
|
755
|
-
cannot_be_blank: Your password cannot be blank.
|
756
|
-
send_instructions: You will receive an email with instructions about how to
|
757
|
-
reset your password in a few minutes.
|
758
|
-
updated: Your password was changed successfully. You are now signed in.
|
759
|
-
user_registrations:
|
760
|
-
destroyed: Bye! Your account was successfully cancelled. We hope to see you
|
761
|
-
again soon.
|
762
|
-
inactive_signed_up: You have signed up successfully. However, we could not sign
|
763
|
-
you in because your account is %{reason}.
|
764
|
-
signed_up: Welcome! You have signed up successfully.
|
765
|
-
updated: You updated your account successfully.
|
766
|
-
user_sessions:
|
767
|
-
signed_in: Signed in successfully.
|
768
|
-
signed_out: Signed out successfully.
|
769
733
|
errors:
|
770
734
|
messages:
|
771
735
|
already_confirmed: was already confirmed
|
@@ -846,6 +810,9 @@ en:
|
|
846
810
|
adjustment_type: Adjustment type
|
847
811
|
adjustments: Adjustments
|
848
812
|
admin:
|
813
|
+
api:
|
814
|
+
key_cleared: Key cleared
|
815
|
+
key_generated: Key generated
|
849
816
|
images:
|
850
817
|
index:
|
851
818
|
choose_files: Choose files to upload
|
@@ -883,6 +850,11 @@ en:
|
|
883
850
|
expires_at_placeholder: Never
|
884
851
|
general: General
|
885
852
|
starts_at_placeholder: Immediately
|
853
|
+
promotion_status:
|
854
|
+
active: Active
|
855
|
+
expired: Expired
|
856
|
+
inactive: Inactive
|
857
|
+
not_started: Not started
|
886
858
|
stock_locations:
|
887
859
|
form:
|
888
860
|
address: Address
|
@@ -1410,15 +1382,17 @@ en:
|
|
1410
1382
|
fulfillable: 'When unchecked, this indicates that items in this location don''t
|
1411
1383
|
require actual fulfilment. Stock will not be checked when shipping and emails
|
1412
1384
|
will not be sent.<br/> Default: Checked'
|
1413
|
-
propagate_all_variants: 'When checked, this will create a stock item for
|
1414
|
-
this stock location.<br/> Default: Checked'
|
1385
|
+
propagate_all_variants: 'When checked, this will create a stock item for each variant
|
1386
|
+
in this stock location.<br/> Default: Checked'
|
1415
1387
|
restock_inventory: 'When checked, returned inventory can be added back to
|
1416
1388
|
this location''s stock levels.<br/> Default: checked'
|
1417
1389
|
spree/store:
|
1418
1390
|
available_locales: This determines which locales are available for your customers
|
1419
1391
|
to choose from in the storefront.
|
1420
|
-
cart_tax_country_iso:
|
1421
|
-
|
1392
|
+
cart_tax_country_iso: "This determines which country is used for taxes on carts
|
1393
|
+
(orders which don't yet have an address).<br/> Default: None."
|
1394
|
+
code: 'An identifier for your store. Developers may need this value if you operate
|
1395
|
+
multiple storefronts.'
|
1422
1396
|
spree/tax_rate:
|
1423
1397
|
validity_period: This determines the validity period within which the tax
|
1424
1398
|
rate is valid and will be applied to eligible items. <br /> If no start
|
@@ -1470,7 +1444,6 @@ en:
|
|
1470
1444
|
quantity.
|
1471
1445
|
intercept_email_address: Intercept Email Address
|
1472
1446
|
intercept_email_instructions: Override email recipient and replace with this address.
|
1473
|
-
internal_name: Internal Name
|
1474
1447
|
invalid_exchange_variant: Invalid exchange variant.
|
1475
1448
|
invalid_payment_method_type: Invalid payment method type.
|
1476
1449
|
invalid_promotion_action: Invalid promotion action.
|
@@ -1800,6 +1773,8 @@ en:
|
|
1800
1773
|
product_source:
|
1801
1774
|
group: From product group
|
1802
1775
|
manual: Manually choose
|
1776
|
+
product_without_default_price_info: 'This Product has no price in the default currency (%{default_currency}).'
|
1777
|
+
product_without_default_price_cta: 'Please, create a Master Price!'
|
1803
1778
|
products: Products
|
1804
1779
|
promotion: Promotion
|
1805
1780
|
promotion_action: Promotion Action
|
@@ -1984,7 +1959,6 @@ en:
|
|
1984
1959
|
ready: Ready
|
1985
1960
|
shipped: Shipped
|
1986
1961
|
shipment_transfer_error: There was an error transferring variants
|
1987
|
-
shipment_transfer_success: Variants successfully transferred
|
1988
1962
|
shipments: Shipments
|
1989
1963
|
shipped: Shipped
|
1990
1964
|
shipped_at: Shipped At
|
@@ -2050,7 +2024,6 @@ en:
|
|
2050
2024
|
order to manage stock.
|
2051
2025
|
stock_movements: Stock Movements
|
2052
2026
|
stock_movements_for_stock_location: Stock Movements for %{stock_location_name}
|
2053
|
-
stock_not_below_zero: Stock must not be below zero.
|
2054
2027
|
stock_successfully_transferred: Stock was successfully transferred between locations.
|
2055
2028
|
stop: Stop
|
2056
2029
|
store: Store
|
@@ -2133,7 +2106,7 @@ en:
|
|
2133
2106
|
message: If you have received this email, then your email settings are correct.
|
2134
2107
|
subject: Test Mail
|
2135
2108
|
test_mode: Test Mode
|
2136
|
-
thank_you_for_your_order: Thank you for your business.
|
2109
|
+
thank_you_for_your_order: Thank you for your business. Please print out a copy
|
2137
2110
|
of this confirmation page for your records.
|
2138
2111
|
there_are_no_items_for_this_order: There are no items for this order. Please add
|
2139
2112
|
an item to the order to continue.
|
@@ -16,6 +16,7 @@ Spree::StoreCreditType.create_with(priority: 1).find_or_create_by!(name: Spree::
|
|
16
16
|
Spree::StoreCreditType.create_with(priority: 2).find_or_create_by!(name: Spree::StoreCreditType::NON_EXPIRING)
|
17
17
|
|
18
18
|
Spree::ReimbursementType.create_with(name: "Store Credit").find_or_create_by!(type: 'Spree::ReimbursementType::StoreCredit')
|
19
|
+
Spree::ReimbursementType.create_with(name: "Original").find_or_create_by!(type: 'Spree::ReimbursementType::OriginalPayment')
|
19
20
|
|
20
21
|
Spree::StoreCreditCategory.find_or_create_by!(name: 'Gift Card')
|
21
22
|
|
data/db/migrate/20161123154034_add_available_to_users_and_remove_display_on_from_shipping_methods.rb
CHANGED
@@ -13,7 +13,7 @@ class AddAvailableToUsersAndRemoveDisplayOnFromShippingMethods < ActiveRecord::M
|
|
13
13
|
add_column(:spree_shipping_methods, :display_on, :string)
|
14
14
|
execute("UPDATE spree_shipping_methods "\
|
15
15
|
"SET display_on='both' "\
|
16
|
-
"WHERE (available_to_users=#{quoted_true}")
|
16
|
+
"WHERE (available_to_users=#{quoted_true})")
|
17
17
|
execute("UPDATE spree_shipping_methods "\
|
18
18
|
"SET display_on='back_end' "\
|
19
19
|
"WHERE (available_to_users=#{quoted_false})")
|
@@ -1,17 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class RenameBogusGateways < ActiveRecord::Migration[5.0]
|
4
|
+
# This migration was only performing a data migration useful updating to
|
5
|
+
# Solidus v2.3.
|
6
|
+
# Once the update is done, this is no more required to run so we can clean
|
7
|
+
# this file to just be a noop.
|
8
|
+
# For more info on the original content see:
|
9
|
+
# https://github.com/solidusio/solidus/pull/2001
|
10
|
+
|
4
11
|
def up
|
5
|
-
|
6
|
-
say_with_time 'Renaming bogus gateways into payment methods' do
|
7
|
-
Solidus::Migrations::RenameGateways.new.up
|
8
|
-
end
|
12
|
+
# no-op
|
9
13
|
end
|
10
14
|
|
11
15
|
def down
|
12
|
-
|
13
|
-
say_with_time 'Renaming bogus payment methods into gateways' do
|
14
|
-
Solidus::Migrations::RenameGateways.new.down
|
15
|
-
end
|
16
|
+
# no-op
|
16
17
|
end
|
17
18
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class DropSpreeStoreCreditUpdateReasons < ActiveRecord::Migration[5.1]
|
4
|
+
# This migration should run in a subsequent deploy after 20180710170104
|
5
|
+
# has been already deployed. See also migration 20180710170104.
|
6
|
+
|
7
|
+
# We can't add back the table in a `down` method here: a previous version
|
8
|
+
# of migration 20180710170104 would fail with `table already exists` , as
|
9
|
+
# it handles itself the add/remove of this table and column.
|
10
|
+
def up
|
11
|
+
if table_exists? :spree_store_credit_update_reasons
|
12
|
+
drop_table :spree_store_credit_update_reasons
|
13
|
+
end
|
14
|
+
|
15
|
+
if column_exists? :spree_store_credit_events, :update_reason_id
|
16
|
+
remove_column :spree_store_credit_events, :update_reason_id
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -58,9 +58,6 @@ module Spree
|
|
58
58
|
|
59
59
|
def setup_assets
|
60
60
|
@lib_name = 'spree'
|
61
|
-
|
62
|
-
empty_directory 'app/assets/images'
|
63
|
-
|
64
61
|
%w{javascripts stylesheets images}.each do |path|
|
65
62
|
empty_directory "vendor/assets/#{path}/spree/frontend" if defined? Spree::Frontend || Rails.env.test?
|
66
63
|
empty_directory "vendor/assets/#{path}/spree/backend" if defined? Spree::Backend || Rails.env.test?
|
@@ -18,6 +18,9 @@ Spree.config do |config|
|
|
18
18
|
# any inventory changes.
|
19
19
|
# config.inventory_cache_threshold = 3
|
20
20
|
|
21
|
+
# Enable Paperclip adapter for attachments on images and taxons
|
22
|
+
config.image_attachment_module = 'Spree::Image::PaperclipAttachment'
|
23
|
+
config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment'
|
21
24
|
|
22
25
|
# Frontend:
|
23
26
|
|
@@ -12,6 +12,8 @@ module Solidus
|
|
12
12
|
attr_reader :gateway_mapping
|
13
13
|
|
14
14
|
def initialize(gateway_mapping = DEFAULT_MAPPING)
|
15
|
+
Spree::Deprecation.warn 'Solidus::Migrations::RenameGateways is deprecated and will be removed with Solidus 3.0.'
|
16
|
+
|
15
17
|
@gateway_mapping = gateway_mapping
|
16
18
|
end
|
17
19
|
|
@@ -423,6 +423,26 @@ module Spree
|
|
423
423
|
# Enumerable of images adhering to the present_image_class interface
|
424
424
|
class_name_attribute :product_gallery_class, default: 'Spree::Gallery::ProductGallery'
|
425
425
|
|
426
|
+
# Allows switching attachment library for Image
|
427
|
+
#
|
428
|
+
# `Spree::Image::PaperclipAttachment`
|
429
|
+
# is the default and provides the classic Paperclip implementation.
|
430
|
+
#
|
431
|
+
# @!attribute [rw] image_attachment_module
|
432
|
+
# @return [Module] a module that can be included into Spree::Image to allow attachments
|
433
|
+
# Enumerable of images adhering to the present_image_class interface
|
434
|
+
class_name_attribute :image_attachment_module, default: 'Spree::Image::PaperclipAttachment'
|
435
|
+
|
436
|
+
# Allows switching attachment library for Taxon
|
437
|
+
#
|
438
|
+
# `Spree::Taxon::PaperclipAttachment`
|
439
|
+
# is the default and provides the classic Paperclip implementation.
|
440
|
+
#
|
441
|
+
# @!attribute [rw] taxon_attachment_module
|
442
|
+
# @return [Module] a module that can be included into Spree::Taxon to allow attachments
|
443
|
+
# Enumerable of taxons adhering to the present_taxon_class interface
|
444
|
+
class_name_attribute :taxon_attachment_module, default: 'Spree::Taxon::PaperclipAttachment'
|
445
|
+
|
426
446
|
# Allows providing your own class instance for generating order numbers.
|
427
447
|
#
|
428
448
|
# @!attribute [rw] order_number_generator
|
@@ -449,6 +469,10 @@ module Spree
|
|
449
469
|
end
|
450
470
|
end
|
451
471
|
|
472
|
+
def events
|
473
|
+
@events_configuration ||= Spree::Event::Configuration.new
|
474
|
+
end
|
475
|
+
|
452
476
|
def environment
|
453
477
|
@environment ||= Spree::Core::Environment.new(self).tap do |env|
|
454
478
|
env.calculators.shipping_methods = %w[
|
data/lib/spree/core.rb
CHANGED
@@ -14,10 +14,7 @@ module Spree
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def current_pricing_options
|
17
|
-
Spree::Config.pricing_options_class.
|
18
|
-
currency: current_store.try!(:default_currency).presence || Spree::Config[:currency],
|
19
|
-
country_iso: current_store.try!(:cart_tax_country_iso).presence
|
20
|
-
)
|
17
|
+
Spree::Config.pricing_options_class.from_context(self)
|
21
18
|
end
|
22
19
|
|
23
20
|
def current_currency
|
@@ -31,30 +31,16 @@ module Spree
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def permitted_checkout_attributes
|
34
|
-
permitted_attributes.checkout_attributes
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
def permitted_checkout_delivery_attributes
|
42
|
-
permitted_attributes.checkout_delivery_attributes
|
43
|
-
end
|
44
|
-
|
45
|
-
def permitted_checkout_payment_attributes
|
46
|
-
permitted_attributes.checkout_payment_attributes
|
47
|
-
end
|
48
|
-
|
49
|
-
def permitted_checkout_confirm_attributes
|
50
|
-
permitted_attributes.checkout_confirm_attributes
|
34
|
+
permitted_attributes.checkout_attributes + [
|
35
|
+
bill_address_attributes: permitted_address_attributes,
|
36
|
+
ship_address_attributes: permitted_address_attributes,
|
37
|
+
payments_attributes: permitted_payment_attributes,
|
38
|
+
shipments_attributes: permitted_shipment_attributes
|
39
|
+
]
|
51
40
|
end
|
52
41
|
|
53
42
|
def permitted_order_attributes
|
54
|
-
|
55
|
-
permitted_checkout_delivery_attributes +
|
56
|
-
permitted_checkout_payment_attributes +
|
57
|
-
permitted_checkout_confirm_attributes + [
|
43
|
+
permitted_checkout_attributes + [
|
58
44
|
line_items_attributes: permitted_line_item_attributes
|
59
45
|
]
|
60
46
|
end
|
data/lib/spree/core/engine.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'spree/config'
|
4
|
+
require 'spree/event/processors/mailer_processor'
|
4
5
|
|
5
6
|
module Spree
|
6
7
|
module Core
|
@@ -44,6 +45,10 @@ module Spree
|
|
44
45
|
Migrations.new(config, engine_name).check
|
45
46
|
end
|
46
47
|
|
48
|
+
initializer 'spree.core.subscribe_event_mailer_processor' do
|
49
|
+
Spree::Event::Processors::MailerProcessor.subscribe!
|
50
|
+
end
|
51
|
+
|
47
52
|
# Load in mailer previews for apps to use in development.
|
48
53
|
# We need to make sure we call `Preview.all` before requiring our
|
49
54
|
# previews, otherwise any previews the app attempts to add need to be
|
@@ -133,9 +133,7 @@ module Spree
|
|
133
133
|
# spree_wombat serializes payment state as status so imported orders should fall back to status field.
|
134
134
|
payment.state = p[:state] || p[:status] || 'completed'
|
135
135
|
payment.payment_method = Spree::PaymentMethod.find_by!(name: p[:payment_method])
|
136
|
-
|
137
|
-
payment.source = create_source_payment_from_params(source_attributes, payment) if source_attributes
|
138
|
-
|
136
|
+
payment.source = create_source_payment_from_params(p[:source], payment) if p[:source]
|
139
137
|
payment.save!
|
140
138
|
end
|
141
139
|
end
|
@@ -18,6 +18,11 @@ module Spree
|
|
18
18
|
@estimator_class.constantize
|
19
19
|
end
|
20
20
|
|
21
|
+
def location_filter_class
|
22
|
+
@location_filter_class ||= '::Spree::Stock::LocationFilter::Active'
|
23
|
+
@location_filter_class.constantize
|
24
|
+
end
|
25
|
+
|
21
26
|
def location_sorter_class
|
22
27
|
@location_sorter_class ||= '::Spree::Stock::LocationSorter::Unsorted'
|
23
28
|
@location_sorter_class.constantize
|