spree_core 4.1.10 → 4.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/line_item.rb +2 -1
- data/app/models/spree/order.rb +7 -2
- data/app/models/spree/order/address_book.rb +7 -20
- data/app/models/spree/promotion_handler/coupon.rb +1 -2
- data/db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb +1 -1
- data/db/migrate/20200102141311_add_social_to_spree_stores.rb +1 -1
- data/db/migrate/20200212144523_add_hide_from_nav_to_taxons.rb +1 -1
- data/lib/generators/spree/dummy/dummy_generator.rb +0 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/testing_support/capybara_ext.rb +7 -0
- data/spree_core.gemspec +2 -2
- metadata +20 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c8287bde543c898068e2948a047426bcbb5e889e72d6959b8d3708be3deef05
|
4
|
+
data.tar.gz: 855883bee8a429ad1517498b487a6f7e7447e9dfadf02b27a408d0020f3f026b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad62daa6a479e57108a618a9896ea281281f489a729af95c5b3ad36052880b0d1eb3005dae876b85d20a3c9d8816f13933d3a0fddd7ced20660e0e946726af9d
|
7
|
+
data.tar.gz: b8403ad63e76b14e42ffd5904c00a3b3b483f3315480790244e6ee3a5566e3289acac67784b3486e3ddf89c1297fa926c083fec53af8c1d16f22cd84bec661f0
|
@@ -66,7 +66,8 @@ module Spree
|
|
66
66
|
|
67
67
|
extend DisplayMoney
|
68
68
|
money_methods :amount, :subtotal, :discounted_amount, :final_amount, :total, :price,
|
69
|
-
:adjustment_total, :additional_tax_total, :promo_total, :included_tax_total
|
69
|
+
:adjustment_total, :additional_tax_total, :promo_total, :included_tax_total,
|
70
|
+
:pre_tax_amount
|
70
71
|
|
71
72
|
alias single_money display_price
|
72
73
|
alias single_display_amount display_price
|
data/app/models/spree/order.rb
CHANGED
@@ -22,7 +22,7 @@ module Spree
|
|
22
22
|
money_methods :outstanding_balance, :item_total, :adjustment_total,
|
23
23
|
:included_tax_total, :additional_tax_total, :tax_total,
|
24
24
|
:shipment_total, :promo_total, :total,
|
25
|
-
:cart_promo_total
|
25
|
+
:cart_promo_total, :pre_tax_item_amount, :pre_tax_total
|
26
26
|
|
27
27
|
alias display_ship_total display_shipment_total
|
28
28
|
alias_attribute :ship_total, :shipment_total
|
@@ -174,7 +174,12 @@ module Spree
|
|
174
174
|
|
175
175
|
# Sum of all line item amounts pre-tax
|
176
176
|
def pre_tax_item_amount
|
177
|
-
line_items.
|
177
|
+
line_items.sum(:pre_tax_amount)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Sum of all line item and shipment pre-tax
|
181
|
+
def pre_tax_total
|
182
|
+
pre_tax_item_amount + shipments.sum(:pre_tax_amount)
|
178
183
|
end
|
179
184
|
|
180
185
|
def shipping_discount
|
@@ -55,31 +55,18 @@ module Spree
|
|
55
55
|
def update_or_create_address(attributes = {})
|
56
56
|
return if attributes.blank?
|
57
57
|
|
58
|
-
attributes
|
58
|
+
attributes.transform_values! { |v| v == '' ? nil : v }
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
return address if address.id
|
63
|
-
end
|
64
|
-
|
65
|
-
if attributes[:id]
|
66
|
-
address = Spree::Address.find(attributes[:id])
|
67
|
-
attributes.delete(:id)
|
60
|
+
default_address_scope = user ? user.addresses : ::Spree::Address
|
61
|
+
default_address = default_address_scope.find_by(id: attributes[:id])
|
68
62
|
|
69
|
-
|
70
|
-
|
71
|
-
return address
|
72
|
-
else
|
73
|
-
attributes.delete(:id)
|
74
|
-
end
|
75
|
-
end
|
63
|
+
if default_address&.editable?
|
64
|
+
default_address.update(attributes)
|
76
65
|
|
77
|
-
|
78
|
-
address = Spree::Address.new(attributes)
|
79
|
-
address.save
|
66
|
+
return default_address
|
80
67
|
end
|
81
68
|
|
82
|
-
|
69
|
+
::Spree::Address.find_or_create_by(attributes.except(:id, :updated_at, :created_at))
|
83
70
|
end
|
84
71
|
end
|
85
72
|
end
|
@@ -25,7 +25,6 @@ module Spree
|
|
25
25
|
|
26
26
|
def remove(coupon_code)
|
27
27
|
promotion = order.promotions.with_coupon_code(coupon_code)
|
28
|
-
|
29
28
|
if promotion.present?
|
30
29
|
# Order promotion has to be destroyed before line item removing
|
31
30
|
order.order_promotions.find_by!(promotion_id: promotion.id).destroy
|
@@ -76,7 +75,7 @@ module Spree
|
|
76
75
|
line_item = order.find_line_item_by_variant(item.variant)
|
77
76
|
next if line_item.blank?
|
78
77
|
|
79
|
-
Spree::Dependencies.cart_remove_item_service(order: order, item: item.variant, quantity: item.quantity)
|
78
|
+
Spree::Dependencies.cart_remove_item_service.constantize.call(order: order, item: item.variant, quantity: item.quantity)
|
80
79
|
end
|
81
80
|
end
|
82
81
|
|
data/lib/spree/core/version.rb
CHANGED
@@ -63,6 +63,13 @@ rescue Selenium::WebDriver::Error::TimeOutError
|
|
63
63
|
default_options[:error].nil? ? false : raise(default_options[:error])
|
64
64
|
end
|
65
65
|
|
66
|
+
# Usage examples:
|
67
|
+
# fill_in_with_force 'CVC', with: 123
|
68
|
+
def fill_in_with_force(locator, with:)
|
69
|
+
field_id = find_field(locator)[:id]
|
70
|
+
page.execute_script "document.getElementById('#{field_id}').value = '#{with}';"
|
71
|
+
end
|
72
|
+
|
66
73
|
Capybara.configure do |config|
|
67
74
|
config.match = :smart
|
68
75
|
config.ignore_hidden_elements = true
|
data/spree_core.gemspec
CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.add_dependency 'monetize', '~> 1.9'
|
40
40
|
s.add_dependency 'paranoia', '~> 2.4.2'
|
41
41
|
s.add_dependency 'premailer-rails'
|
42
|
-
s.add_dependency 'rails', '
|
42
|
+
s.add_dependency 'rails', '>= 5.2', '< 6.1'
|
43
43
|
s.add_dependency 'ransack', '~> 2.3.0'
|
44
44
|
s.add_dependency 'responders'
|
45
45
|
s.add_dependency 'state_machines-activerecord', '~> 0.6'
|
@@ -48,7 +48,7 @@ Gem::Specification.new do |s|
|
|
48
48
|
s.add_dependency 'twitter_cldr', '>= 4.3', '< 7.0'
|
49
49
|
s.add_dependency 'sprockets', '~> 3.7'
|
50
50
|
s.add_dependency 'sprockets-rails'
|
51
|
-
s.add_dependency 'mini_magick', '>= 4.9.4', '< 4.
|
51
|
+
s.add_dependency 'mini_magick', '>= 4.9.4', '< 4.12.0'
|
52
52
|
s.add_dependency 'image_processing', '~> 1.2'
|
53
53
|
|
54
54
|
s.add_development_dependency 'email_spec', '~> 2.2'
|
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: 4.1.
|
4
|
+
version: 4.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -214,16 +214,22 @@ dependencies:
|
|
214
214
|
name: rails
|
215
215
|
requirement: !ruby/object:Gem::Requirement
|
216
216
|
requirements:
|
217
|
-
- - "
|
217
|
+
- - ">="
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '5.2'
|
220
|
+
- - "<"
|
218
221
|
- !ruby/object:Gem::Version
|
219
|
-
version: 6.
|
222
|
+
version: '6.1'
|
220
223
|
type: :runtime
|
221
224
|
prerelease: false
|
222
225
|
version_requirements: !ruby/object:Gem::Requirement
|
223
226
|
requirements:
|
224
|
-
- - "
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '5.2'
|
230
|
+
- - "<"
|
225
231
|
- !ruby/object:Gem::Version
|
226
|
-
version: 6.
|
232
|
+
version: '6.1'
|
227
233
|
- !ruby/object:Gem::Dependency
|
228
234
|
name: ransack
|
229
235
|
requirement: !ruby/object:Gem::Requirement
|
@@ -351,7 +357,7 @@ dependencies:
|
|
351
357
|
version: 4.9.4
|
352
358
|
- - "<"
|
353
359
|
- !ruby/object:Gem::Version
|
354
|
-
version: 4.
|
360
|
+
version: 4.12.0
|
355
361
|
type: :runtime
|
356
362
|
prerelease: false
|
357
363
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -361,7 +367,7 @@ dependencies:
|
|
361
367
|
version: 4.9.4
|
362
368
|
- - "<"
|
363
369
|
- !ruby/object:Gem::Version
|
364
|
-
version: 4.
|
370
|
+
version: 4.12.0
|
365
371
|
- !ruby/object:Gem::Dependency
|
366
372
|
name: image_processing
|
367
373
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1089,10 +1095,10 @@ licenses:
|
|
1089
1095
|
- BSD-3-Clause
|
1090
1096
|
metadata:
|
1091
1097
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1092
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.1.
|
1098
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.1.14
|
1093
1099
|
documentation_uri: https://guides.spreecommerce.org/
|
1094
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.1.
|
1095
|
-
post_install_message:
|
1100
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.1.14
|
1101
|
+
post_install_message:
|
1096
1102
|
rdoc_options: []
|
1097
1103
|
require_paths:
|
1098
1104
|
- lib
|
@@ -1107,8 +1113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1107
1113
|
- !ruby/object:Gem::Version
|
1108
1114
|
version: 1.8.23
|
1109
1115
|
requirements: []
|
1110
|
-
rubygems_version: 3.
|
1111
|
-
signing_key:
|
1116
|
+
rubygems_version: 3.2.3
|
1117
|
+
signing_key:
|
1112
1118
|
specification_version: 4
|
1113
1119
|
summary: The bare bones necessary for Spree.
|
1114
1120
|
test_files: []
|