solidus_core 2.11.7 → 3.0.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/javascripts/spree.js.erb +0 -51
- data/app/helpers/spree/store_helper.rb +0 -11
- data/app/mailers/spree/carton_mailer.rb +1 -5
- data/app/models/concerns/spree/active_storage_adapter.rb +2 -0
- data/app/models/concerns/spree/active_storage_adapter/attachment.rb +11 -11
- data/app/models/concerns/spree/adjustment_source.rb +0 -15
- data/app/models/concerns/spree/calculated_adjustments.rb +0 -18
- data/app/models/concerns/spree/soft_deletable.rb +2 -4
- data/app/models/concerns/spree/user_address_book.rb +0 -37
- data/app/models/concerns/spree/user_methods.rb +2 -11
- data/app/models/spree/ability.rb +0 -37
- data/app/models/spree/address.rb +8 -186
- data/app/models/spree/address/name.rb +2 -20
- data/app/models/spree/adjustment.rb +0 -28
- data/app/models/spree/base.rb +0 -35
- data/app/models/spree/calculator.rb +4 -7
- data/app/models/spree/calculator/flexi_rate.rb +0 -5
- data/app/models/spree/country.rb +1 -6
- data/app/models/spree/credit_card.rb +0 -27
- data/app/models/spree/customer_return.rb +1 -4
- data/app/models/spree/image.rb +0 -7
- data/app/models/spree/image/active_storage_attachment.rb +10 -2
- data/app/models/spree/image/paperclip_attachment.rb +1 -1
- data/app/models/spree/inventory_unit.rb +0 -21
- data/app/models/spree/line_item.rb +2 -45
- data/app/models/spree/order.rb +3 -136
- data/app/models/spree/order_cancellations.rb +4 -24
- data/app/models/spree/order_updater.rb +2 -11
- data/app/models/spree/payment.rb +0 -3
- data/app/models/spree/payment/cancellation.rb +1 -1
- data/app/models/spree/payment_create.rb +1 -13
- data/app/models/spree/payment_method.rb +5 -103
- data/app/models/spree/payment_method/bogus_credit_card.rb +13 -9
- data/app/models/spree/payment_method/credit_card.rb +1 -3
- data/app/models/spree/payment_method/simple_bogus_credit_card.rb +4 -4
- data/app/models/spree/product.rb +0 -39
- data/app/models/spree/product/scopes.rb +0 -27
- data/app/models/spree/promotion.rb +2 -6
- data/app/models/spree/promotion/actions/create_adjustment.rb +0 -3
- data/app/models/spree/promotion/actions/create_item_adjustments.rb +0 -3
- data/app/models/spree/promotion/actions/create_quantity_adjustments.rb +0 -3
- data/app/models/spree/promotion/rules/taxon.rb +2 -15
- data/app/models/spree/promotion_action.rb +5 -9
- data/app/models/spree/promotion_code/batch_builder.rb +0 -14
- data/app/models/spree/promotion_rule.rb +4 -0
- data/app/models/spree/refund.rb +0 -50
- data/app/models/spree/reimbursement.rb +3 -41
- data/app/models/spree/reimbursement_performer.rb +2 -8
- data/app/models/spree/reimbursement_type/credit.rb +1 -4
- data/app/models/spree/reimbursement_type/reimbursement_helpers.rb +1 -2
- data/app/models/spree/reimbursement_type/store_credit.rb +1 -4
- data/app/models/spree/return_authorization.rb +1 -4
- data/app/models/spree/return_item.rb +1 -19
- data/app/models/spree/shipment.rb +1 -54
- data/app/models/spree/shipping_method.rb +0 -25
- data/app/models/spree/shipping_rate.rb +0 -2
- data/app/models/spree/state.rb +0 -4
- data/app/models/spree/stock/simple_coordinator.rb +0 -14
- data/app/models/spree/stock/splitter/base.rb +2 -7
- data/app/models/spree/stock_item.rb +1 -7
- data/app/models/spree/store.rb +0 -12
- data/app/models/spree/store_credit_category.rb +0 -32
- data/app/models/spree/tax_calculator/shipping_rate.rb +1 -12
- data/app/models/spree/tax_rate.rb +0 -27
- data/app/models/spree/taxon.rb +0 -11
- data/app/models/spree/taxon/active_storage_attachment.rb +0 -5
- data/app/models/spree/taxon/paperclip_attachment.rb +0 -5
- data/app/models/spree/user_address.rb +0 -5
- data/app/models/spree/variant.rb +1 -45
- data/config/locales/en.yml +0 -8
- data/db/migrate/20180416083007_add_apply_to_all_to_variant_property_rule.rb +1 -1
- data/lib/generators/solidus/install/install_generator.rb +13 -2
- data/lib/generators/solidus/install/templates/config/initializers/spree.rb.tt +3 -39
- data/lib/generators/spree/dummy/dummy_generator.rb +2 -1
- data/lib/generators/spree/dummy/templates/rails/database.yml +6 -1
- data/lib/generators/spree/dummy/templates/rails/storage.yml +3 -0
- data/lib/generators/spree/dummy/templates/rails/test.rb +2 -0
- data/lib/spree/app_configuration.rb +14 -65
- data/lib/spree/core.rb +9 -8
- data/lib/spree/core/class_constantizer.rb +2 -0
- data/lib/spree/core/controller_helpers/auth.rb +1 -14
- data/lib/spree/core/controller_helpers/order.rb +2 -22
- data/lib/spree/core/controller_helpers/payment_parameters.rb +0 -54
- data/lib/spree/core/controller_helpers/pricing.rb +0 -8
- data/lib/spree/core/controller_helpers/strong_parameters.rb +0 -4
- data/lib/spree/core/engine.rb +0 -35
- data/lib/spree/core/environment_extension.rb +0 -9
- data/lib/spree/core/product_filters.rb +0 -40
- data/lib/spree/core/role_configuration.rb +0 -14
- data/lib/spree/core/search/base.rb +0 -26
- data/lib/spree/core/state_machines.rb +2 -11
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/deprecation.rb +1 -1
- data/lib/spree/event.rb +0 -31
- data/lib/spree/event/configuration.rb +0 -5
- data/lib/spree/event/subscriber.rb +0 -18
- data/lib/spree/event/subscriber_registry.rb +3 -1
- data/lib/spree/i18n.rb +0 -22
- data/lib/spree/money.rb +3 -18
- data/lib/spree/permitted_attributes.rb +2 -53
- data/lib/spree/preferences/persistable.rb +23 -0
- data/lib/spree/testing_support/capybara_ext.rb +0 -30
- data/lib/spree/testing_support/controller_requests.rb +0 -82
- data/lib/spree/testing_support/dummy_app.rb +6 -14
- data/lib/spree/testing_support/dummy_app/migrations.rb +0 -3
- data/lib/spree/testing_support/factories/order_factory.rb +0 -1
- data/lib/spree/testing_support/factories/refund_factory.rb +0 -1
- data/lib/spree/testing_support/fixtures/file.txt +1 -0
- data/lib/spree/testing_support/order_walkthrough.rb +0 -3
- data/lib/spree/testing_support/preferences.rb +0 -25
- data/lib/tasks/upgrade.rake +7 -5
- data/solidus_core.gemspec +2 -5
- metadata +9 -48
- data/app/mailers/spree/test_mailer.rb +0 -13
- data/app/models/concerns/spree/user_payment_source.rb +0 -26
- data/app/models/spree/calculator/free_shipping.rb +0 -22
- data/app/models/spree/calculator/percent_per_item.rb +0 -51
- data/app/models/spree/calculator/price_sack.rb +0 -28
- data/app/models/spree/gateway.rb +0 -14
- data/app/models/spree/gateway/bogus.rb +0 -13
- data/app/models/spree/gateway/bogus_simple.rb +0 -13
- data/app/models/spree/order/checkout.rb +0 -244
- data/app/models/spree/order_capturing.rb +0 -50
- data/app/models/spree/promotion_handler/free_shipping.rb +0 -9
- data/lib/generators/spree/install/install_generator.rb +0 -15
- data/lib/solidus/migrations/rename_gateways.rb +0 -41
- data/lib/spree/core/current_store.rb +0 -24
- data/lib/spree/paranoia_deprecations.rb +0 -41
- data/lib/spree/promo/environment.rb +0 -12
- data/lib/spree/testing_support/bar_ability.rb +0 -19
- data/lib/tasks/core.rake +0 -104
- data/lib/tasks/email.rake +0 -12
- data/lib/tasks/migrations/copy_order_bill_address_to_credit_card.rake +0 -119
- data/lib/tasks/migrations/migrate_address_names.rake +0 -158
- data/lib/tasks/migrations/migrate_default_billing_addresses_to_address_book.rake +0 -38
- data/lib/tasks/migrations/migrate_shipping_rate_taxes.rake +0 -22
- data/lib/tasks/migrations/migrate_user_addresses.rake +0 -34
- data/lib/tasks/migrations/rename_gateways.rake +0 -23
- data/lib/tasks/order_capturing.rake +0 -27
data/lib/spree/money.rb
CHANGED
@@ -6,7 +6,6 @@ module Spree
|
|
6
6
|
class Money
|
7
7
|
include Comparable
|
8
8
|
DifferentCurrencyError = Class.new(StandardError)
|
9
|
-
RUBY_NUMERIC_STRING = /\A-?\d+(\.\d+)?\z/
|
10
9
|
|
11
10
|
class <<self
|
12
11
|
attr_accessor :default_formatting_rules
|
@@ -37,15 +36,8 @@ module Spree
|
|
37
36
|
@money = amount
|
38
37
|
else
|
39
38
|
currency = (options[:currency] || Spree::Config[:currency])
|
40
|
-
|
41
|
-
|
42
|
-
else
|
43
|
-
@money = Spree::Money.parse_to_money(amount, currency)
|
44
|
-
Spree::Deprecation.warn <<-WARN.squish, caller
|
45
|
-
Spree::Money was initialized with #{amount.inspect}, which will not be supported in the future.
|
46
|
-
Instead use Spree::Money.new(#{@money.to_s.inspect}, options) or Spree::Money.parse(#{amount.inspect})
|
47
|
-
WARN
|
48
|
-
end
|
39
|
+
|
40
|
+
@money = Monetize.from_string(amount, currency)
|
49
41
|
end
|
50
42
|
@options = Spree::Money.default_formatting_rules.merge(options)
|
51
43
|
end
|
@@ -80,14 +72,7 @@ module Spree
|
|
80
72
|
def to_html(options = { html_wrap: true })
|
81
73
|
output = format(options)
|
82
74
|
# Maintain compatibility by checking html option renamed to html_wrap.
|
83
|
-
if options[:
|
84
|
-
Spree::Deprecation.warn <<-WARN.squish, caller
|
85
|
-
Spree::Money#to_html called with Spree::Money#to_html(html: #{options[:html].inspect}),
|
86
|
-
which will not be supported in the future.
|
87
|
-
Instead use :html_wrap e.g. Spree::Money#to_html(html_wrap: #{options[:html].inspect})
|
88
|
-
WARN
|
89
|
-
end
|
90
|
-
if options[:html_wrap] || options[:html]
|
75
|
+
if options[:html_wrap]
|
91
76
|
output = output.html_safe
|
92
77
|
end
|
93
78
|
output
|
@@ -39,8 +39,7 @@ module Spree
|
|
39
39
|
mattr_reader(*ATTRIBUTES)
|
40
40
|
|
41
41
|
@@address_attributes = [
|
42
|
-
:id, :name, :
|
43
|
-
:address1, :address2, :city, :country_id, :state_id,
|
42
|
+
:id, :name, :address1, :address2, :city, :country_id, :state_id,
|
44
43
|
:zipcode, :phone, :state_name, :country_iso, :alternative_phone, :company,
|
45
44
|
country: [:iso, :name, :iso3, :iso_name],
|
46
45
|
state: [:name, :abbr]
|
@@ -90,7 +89,7 @@ module Spree
|
|
90
89
|
:number, :month, :year, :expiry, :verification_value,
|
91
90
|
:first_name, :last_name, :cc_type, :gateway_customer_profile_id,
|
92
91
|
:gateway_payment_profile_id, :last_digits, :name, :encrypted_data,
|
93
|
-
:
|
92
|
+
:wallet_payment_source_id, address_attributes: address_attributes
|
94
93
|
]
|
95
94
|
|
96
95
|
@@stock_item_attributes = [:variant, :stock_location, :backorderable, :variant_id]
|
@@ -143,61 +142,11 @@ module Spree
|
|
143
142
|
]
|
144
143
|
|
145
144
|
@@checkout_payment_attributes = [
|
146
|
-
:coupon_code,
|
147
145
|
payments_attributes: payment_attributes + [
|
148
146
|
source_attributes: source_attributes
|
149
147
|
]
|
150
148
|
]
|
151
149
|
|
152
150
|
@@checkout_confirm_attributes = []
|
153
|
-
|
154
|
-
def self.checkout_attributes
|
155
|
-
Spree::Deprecation.warn <<-WARN.squish, caller
|
156
|
-
checkout_attributes is deprecated, please use the permitted
|
157
|
-
attributes set for the specific step that needs to be updated.
|
158
|
-
|
159
|
-
E.g. permitted_checkout_address_attributes
|
160
|
-
WARN
|
161
|
-
|
162
|
-
CheckoutAdditionalAttributes.new(
|
163
|
-
checkout_address_attributes +
|
164
|
-
checkout_delivery_attributes +
|
165
|
-
checkout_payment_attributes +
|
166
|
-
checkout_confirm_attributes
|
167
|
-
)
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
class CheckoutAdditionalAttributes < Array
|
172
|
-
def <<(*attributes)
|
173
|
-
super
|
174
|
-
|
175
|
-
inject_attributes_to_all_steps(attributes, :<<)
|
176
|
-
end
|
177
|
-
|
178
|
-
def push(*attributes)
|
179
|
-
super
|
180
|
-
|
181
|
-
inject_attributes_to_all_steps(attributes, :push)
|
182
|
-
end
|
183
|
-
alias append push
|
184
|
-
|
185
|
-
def prepend(*attributes)
|
186
|
-
super
|
187
|
-
|
188
|
-
inject_attributes_to_all_steps(attributes, :prepend)
|
189
|
-
end
|
190
|
-
alias unshift prepend
|
191
|
-
|
192
|
-
private
|
193
|
-
|
194
|
-
def inject_attributes_to_all_steps(attributes, method_name)
|
195
|
-
attributes.each do |attribute|
|
196
|
-
PermittedAttributes.checkout_address_attributes.send(method_name, attribute)
|
197
|
-
PermittedAttributes.checkout_delivery_attributes.send(method_name, attribute)
|
198
|
-
PermittedAttributes.checkout_payment_attributes.send(method_name, attribute)
|
199
|
-
PermittedAttributes.checkout_confirm_attributes.send(method_name, attribute)
|
200
|
-
end
|
201
|
-
end
|
202
151
|
end
|
203
152
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
module Preferences
|
5
|
+
module Persistable
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
include Spree::Preferences::Preferable
|
10
|
+
serialize :preferences, Hash
|
11
|
+
after_initialize :initialize_preference_defaults
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def initialize_preference_defaults
|
17
|
+
if has_attribute?(:preferences)
|
18
|
+
self.preferences = default_preferences.merge(preferences)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -35,18 +35,6 @@ module Spree
|
|
35
35
|
find("td:nth-of-type(#{num})").text
|
36
36
|
end
|
37
37
|
|
38
|
-
def fill_in_quantity(table_column, selector, quantity)
|
39
|
-
Spree::Deprecation.warn <<-WARN.strip_heredoc
|
40
|
-
fill_in_quantity is deprecated. Instead use:
|
41
|
-
within(#{table_column.inspect}) do
|
42
|
-
fill_in #{selector.inspect}, with: #{quantity.inspect}
|
43
|
-
end
|
44
|
-
WARN
|
45
|
-
within(table_column) do
|
46
|
-
fill_in selector, with: quantity
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
38
|
def select2_search(value, options)
|
51
39
|
options = {
|
52
40
|
search: value, # by default search for the value
|
@@ -122,21 +110,6 @@ module Spree
|
|
122
110
|
# find the original.
|
123
111
|
find('label:not(.select2-offscreen)', text: /#{Regexp.escape(text)}/i, match: :one)
|
124
112
|
end
|
125
|
-
|
126
|
-
def wait_for_ajax
|
127
|
-
Spree::Deprecation.warn <<-WARN.squish, caller
|
128
|
-
wait_for_ajax has been deprecated.
|
129
|
-
Please refer to the capybara documentation on how to properly wait for asyncronous behavior:
|
130
|
-
https://github.com/teamcapybara/capybara#asynchronous-javascript-ajax-and-friends
|
131
|
-
WARN
|
132
|
-
|
133
|
-
counter = 0
|
134
|
-
while page.evaluate_script("typeof($) === 'undefined' || $.active > 0")
|
135
|
-
counter += 1
|
136
|
-
sleep(0.1)
|
137
|
-
raise "AJAX request took longer than 5 seconds." if counter >= 50
|
138
|
-
end
|
139
|
-
end
|
140
113
|
end
|
141
114
|
end
|
142
115
|
end
|
@@ -156,9 +129,6 @@ RSpec::Matchers.define :have_meta do |name, expected|
|
|
156
129
|
end
|
157
130
|
end
|
158
131
|
|
159
|
-
# @private
|
160
|
-
CapybaraExt = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('CapybaraExt', 'Spree::TestingSupport::CapybaraExt')
|
161
|
-
|
162
132
|
RSpec.configure do |c|
|
163
133
|
c.include Spree::TestingSupport::CapybaraExt
|
164
134
|
end
|
@@ -2,23 +2,12 @@
|
|
2
2
|
|
3
3
|
module Spree
|
4
4
|
module TestingSupport
|
5
|
-
# A module providing convenience methods to test Solidus controllers
|
6
|
-
# in Rails controller/functional tests. Possibly from inside an
|
7
|
-
# application with a mounted Solidus engine.
|
8
|
-
#
|
9
5
|
# *There is generaly no need* to use this module. Instead, in
|
10
6
|
# a functional/controller test against a Spree controller, just
|
11
7
|
# use standard Rails functionality by including:
|
12
8
|
#
|
13
9
|
# routes { Spree::Core::Engine.routes }
|
14
10
|
#
|
15
|
-
# And then use standard Rails test `get`, `post` etc methods.
|
16
|
-
#
|
17
|
-
# But some legacy code uses this ControllerRequests helper. It must
|
18
|
-
# be included only in tests against Spree controllers, it will interfere
|
19
|
-
# with tests against local app or other engine controllers, resulting
|
20
|
-
# in ActionController::UrlGenerationError.
|
21
|
-
#
|
22
11
|
# To use this module, inside your spec_helper.rb, include this module inside
|
23
12
|
# the RSpec.configure block by:
|
24
13
|
#
|
@@ -26,83 +15,12 @@ module Spree
|
|
26
15
|
# RSpec.configure do |c|
|
27
16
|
# c.include Spree::TestingSupport::ControllerRequests, spree_controller: true
|
28
17
|
# end
|
29
|
-
#
|
30
|
-
# Then, in your controller tests against spree controllers, you can access
|
31
|
-
# tag to use this module, and access spree routes like this:
|
32
|
-
#
|
33
|
-
# require 'spec_helper'
|
34
|
-
#
|
35
|
-
# describe Spree::ProductsController, :spree_controller do
|
36
|
-
# it "can see all the products" do
|
37
|
-
# spree_get :index
|
38
|
-
# end
|
39
|
-
# end
|
40
|
-
#
|
41
|
-
# Use spree_get, spree_post, spree_put or spree_delete to make requests to
|
42
|
-
# the Spree engine, and use regular get, post, put or delete to make
|
43
|
-
# requests to your application.
|
44
18
|
module ControllerRequests
|
45
19
|
extend ActiveSupport::Concern
|
46
20
|
|
47
21
|
included do
|
48
22
|
routes { Spree::Core::Engine.routes }
|
49
23
|
end
|
50
|
-
|
51
|
-
def spree_get(action, parameters = nil, session = nil, flash = nil)
|
52
|
-
process_spree_action(action, parameters, session, flash, "GET")
|
53
|
-
end
|
54
|
-
deprecate spree_get: :get, deprecator: Spree::Deprecation
|
55
|
-
|
56
|
-
# Executes a request simulating POST HTTP method and set/volley the response
|
57
|
-
def spree_post(action, parameters = nil, session = nil, flash = nil)
|
58
|
-
process_spree_action(action, parameters, session, flash, "POST")
|
59
|
-
end
|
60
|
-
deprecate spree_post: :post, deprecator: Spree::Deprecation
|
61
|
-
|
62
|
-
# Executes a request simulating PUT HTTP method and set/volley the response
|
63
|
-
def spree_put(action, parameters = nil, session = nil, flash = nil)
|
64
|
-
process_spree_action(action, parameters, session, flash, "PUT")
|
65
|
-
end
|
66
|
-
deprecate spree_put: :put, deprecator: Spree::Deprecation
|
67
|
-
|
68
|
-
# Executes a request simulating DELETE HTTP method and set/volley the response
|
69
|
-
def spree_delete(action, parameters = nil, session = nil, flash = nil)
|
70
|
-
process_spree_action(action, parameters, session, flash, "DELETE")
|
71
|
-
end
|
72
|
-
deprecate spree_delete: :delete, deprecator: Spree::Deprecation
|
73
|
-
|
74
|
-
def spree_xhr_get(action, parameters = nil, session = nil, flash = nil)
|
75
|
-
process_spree_xhr_action(action, parameters, session, flash, :get)
|
76
|
-
end
|
77
|
-
deprecate spree_xhr_get: :get, deprecator: Spree::Deprecation
|
78
|
-
|
79
|
-
def spree_xhr_post(action, parameters = nil, session = nil, flash = nil)
|
80
|
-
process_spree_xhr_action(action, parameters, session, flash, :post)
|
81
|
-
end
|
82
|
-
deprecate spree_xhr_post: :post, deprecator: Spree::Deprecation
|
83
|
-
|
84
|
-
def spree_xhr_put(action, parameters = nil, session = nil, flash = nil)
|
85
|
-
process_spree_xhr_action(action, parameters, session, flash, :put)
|
86
|
-
end
|
87
|
-
deprecate spree_xhr_put: :put, deprecator: Spree::Deprecation
|
88
|
-
|
89
|
-
def spree_xhr_delete(action, parameters = nil, session = nil, flash = nil)
|
90
|
-
process_spree_xhr_action(action, parameters, session, flash, :delete)
|
91
|
-
end
|
92
|
-
deprecate spree_xhr_delete: :delete, deprecator: Spree::Deprecation
|
93
|
-
|
94
|
-
private
|
95
|
-
|
96
|
-
def process_spree_action(action, parameters = nil, session = nil, flash = nil, method = "GET")
|
97
|
-
parameters ||= {}
|
98
|
-
process(action, method, parameters, session, flash)
|
99
|
-
end
|
100
|
-
|
101
|
-
def process_spree_xhr_action(action, parameters = nil, session = nil, flash = nil, method = :get)
|
102
|
-
parameters ||= {}
|
103
|
-
parameters.reverse_merge!(format: :json)
|
104
|
-
xml_http_request(method, action, parameters, session, flash)
|
105
|
-
end
|
106
24
|
end
|
107
25
|
end
|
108
26
|
end
|
@@ -7,6 +7,7 @@ require 'rails'
|
|
7
7
|
require 'active_record/railtie'
|
8
8
|
require 'action_controller/railtie'
|
9
9
|
require 'action_mailer/railtie'
|
10
|
+
require 'active_storage/engine'
|
10
11
|
|
11
12
|
Rails.env = 'test'
|
12
13
|
|
@@ -67,7 +68,7 @@ module DummyApp
|
|
67
68
|
|
68
69
|
config.storage_path = Rails.root.join('tmp', 'storage')
|
69
70
|
|
70
|
-
|
71
|
+
unless ENV['DISABLE_ACTIVE_STORAGE']
|
71
72
|
initializer 'solidus.active_storage' do
|
72
73
|
config.active_storage.service_configurations = {
|
73
74
|
test: {
|
@@ -116,20 +117,11 @@ end
|
|
116
117
|
|
117
118
|
Spree.user_class = 'Spree::LegacyUser'
|
118
119
|
Spree.config do |config|
|
119
|
-
config.use_legacy_address_state_validator = false
|
120
120
|
config.mails_from = "store@example.com"
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
config.use_legacy_order_state_machine = false
|
126
|
-
config.use_custom_cancancan_actions = false
|
127
|
-
config.consider_actionless_promotion_active = false
|
128
|
-
config.use_legacy_store_credit_reimbursement_category_name = false
|
129
|
-
|
130
|
-
if ENV['ENABLE_ACTIVE_STORAGE']
|
131
|
-
config.image_attachment_module = 'Spree::Image::ActiveStorageAttachment'
|
132
|
-
config.taxon_attachment_module = 'Spree::Taxon::ActiveStorageAttachment'
|
121
|
+
|
122
|
+
if ENV['DISABLE_ACTIVE_STORAGE']
|
123
|
+
config.image_attachment_module = 'Spree::Image::PaperclipAttachment'
|
124
|
+
config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment'
|
133
125
|
end
|
134
126
|
end
|
135
127
|
|
@@ -27,9 +27,6 @@ module DummyApp
|
|
27
27
|
ActiveRecord::Base.remove_connection
|
28
28
|
|
29
29
|
sh 'rake db:reset VERBOSE=false'
|
30
|
-
if ENV['ENABLE_ACTIVE_STORAGE']
|
31
|
-
sh 'rake active_storage:install db:migrate VERBOSE=false'
|
32
|
-
end
|
33
30
|
|
34
31
|
# We have a brand new database, so we must re-establish our connection
|
35
32
|
ActiveRecord::Base.establish_connection
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a text file
|
@@ -1,33 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/deprecation'
|
4
|
-
|
5
3
|
module Spree
|
6
4
|
module TestingSupport
|
7
5
|
module Preferences
|
8
|
-
# Resets all preferences to default values, you can
|
9
|
-
# pass a block to override the defaults with a block
|
10
|
-
#
|
11
|
-
# reset_spree_preferences do |config|
|
12
|
-
# config.track_inventory_levels = false
|
13
|
-
# end
|
14
|
-
#
|
15
|
-
# @deprecated
|
16
|
-
def reset_spree_preferences(&config_block)
|
17
|
-
Spree::Config.instance_variables.
|
18
|
-
reject { |iv| iv == :@events_configuration }.
|
19
|
-
each { |iv| Spree::Config.remove_instance_variable(iv) }
|
20
|
-
Spree::Config.preference_store = Spree::Config.default_preferences
|
21
|
-
|
22
|
-
if defined?(Railties)
|
23
|
-
Rails.application.config.spree = Spree::Config.environment
|
24
|
-
end
|
25
|
-
|
26
|
-
configure_spree_preferences(&config_block) if block_given?
|
27
|
-
end
|
28
|
-
|
29
|
-
deprecate :reset_spree_preferences, deprecator: Spree::Deprecation
|
30
|
-
|
31
6
|
def configure_spree_preferences
|
32
7
|
yield(Spree::Config) if block_given?
|
33
8
|
end
|
data/lib/tasks/upgrade.rake
CHANGED
@@ -2,12 +2,14 @@
|
|
2
2
|
|
3
3
|
namespace :solidus do
|
4
4
|
namespace :upgrade do
|
5
|
-
|
6
|
-
|
7
|
-
'
|
8
|
-
'solidus:migrations:migrate_address_names:up'
|
5
|
+
task three_point_zero: [
|
6
|
+
'railties:install:migrations',
|
7
|
+
'db:migrate'
|
9
8
|
] do
|
10
|
-
puts "Your Solidus install is ready for Solidus
|
9
|
+
puts "Your Solidus install is ready for Solidus 3.0"
|
11
10
|
end
|
12
11
|
end
|
12
|
+
|
13
|
+
desc "Upgrade to the current Solidus version"
|
14
|
+
task upgrade: 'upgrade:three_point_zero'
|
13
15
|
end
|
data/solidus_core.gemspec
CHANGED
@@ -39,8 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.add_dependency 'kaminari-activerecord', '~> 1.1'
|
40
40
|
s.add_dependency 'mini_magick', '~> 4.10'
|
41
41
|
s.add_dependency 'monetize', '~> 1.8'
|
42
|
-
s.add_dependency 'paperclip', '
|
43
|
-
s.add_dependency 'paranoia', '~> 2.4'
|
42
|
+
s.add_dependency 'kt-paperclip', '~> 6.3'
|
44
43
|
s.add_dependency 'ransack', '~> 2.0'
|
45
44
|
s.add_dependency 'state_machines-activerecord', '~> 0.6'
|
46
45
|
|
@@ -56,9 +55,7 @@ $ bin/rails g solidus:install
|
|
56
55
|
If you are updating Solidus from an older version, please run
|
57
56
|
the following commands to complete the update:
|
58
57
|
|
59
|
-
$ bin/rails
|
60
|
-
$ bin/rails db:migrate
|
61
|
-
$ bin/rails solidus:upgrade:two_point_eleven
|
58
|
+
$ bin/rails solidus:upgrade
|
62
59
|
|
63
60
|
Please report any issues at:
|
64
61
|
- https://github.com/solidusio/solidus/issues
|