spree_core 4.1.10 → 4.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6076d4a3647fbf0b2a1a72578b5cd9336181f4b50c40bda5f7dcffab9806e4a
4
- data.tar.gz: 663b00f1b45448020c4274925264c31ef11363fc6bd4561db5eff1f8897c4b5f
3
+ metadata.gz: 3c8287bde543c898068e2948a047426bcbb5e889e72d6959b8d3708be3deef05
4
+ data.tar.gz: 855883bee8a429ad1517498b487a6f7e7447e9dfadf02b27a408d0020f3f026b
5
5
  SHA512:
6
- metadata.gz: 235b59d743b4d580fe4b9e2a16d082a39285bccbee99f9fea6615c65e0e760a9134a0267ed9def3d9bac5fa76974416127dbdaeeac52865b8578b6926a5d2c65
7
- data.tar.gz: 2bdc502c7b9134df69893818a1e230bd546ff895f8d0733e4ff380dbb2a8c4be9eccfe0acc356c8e618ad2d75d75f74228955af8961231617e00e0ec19e6ec27
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
@@ -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.to_a.sum(&:pre_tax_amount)
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 = attributes.select { |_k, v| v.present? }
58
+ attributes.transform_values! { |v| v == '' ? nil : v }
59
59
 
60
- if user
61
- address = user.addresses.build(attributes.except(:id)).check
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
- if address&.editable?
70
- address.update(attributes)
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
- unless attributes[:id]
78
- address = Spree::Address.new(attributes)
79
- address.save
66
+ return default_address
80
67
  end
81
68
 
82
- address
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
 
@@ -1,4 +1,4 @@
1
- class AddDeafultValueForStoreDefaultCurrency < ActiveRecord::Migration[6.0]
1
+ class AddDeafultValueForStoreDefaultCurrency < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  Spree::Store.where(default_currency: nil).update_all(default_currency: Spree::Config[:currency])
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddSocialToSpreeStores < ActiveRecord::Migration[6.0]
1
+ class AddSocialToSpreeStores < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :spree_stores, :facebook, :string
4
4
  add_column :spree_stores, :twitter, :string
@@ -1,4 +1,4 @@
1
- class AddHideFromNavToTaxons < ActiveRecord::Migration[6.0]
1
+ class AddHideFromNavToTaxons < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :spree_taxons, :hide_from_nav, :boolean, default: false, index: true
4
4
  end
@@ -32,7 +32,6 @@ module Spree
32
32
  opts[:skip_bundle] = true
33
33
  opts[:skip_gemfile] = true
34
34
  opts[:skip_git] = true
35
- opts[:skip_keeps] = true
36
35
  opts[:skip_listen] = true
37
36
  opts[:skip_rc] = true
38
37
  opts[:skip_spring] = true
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '4.1.10'
3
+ '4.1.14'
4
4
  end
5
5
  end
@@ -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', '~> 6.0.0'
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.11.0'
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.10
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: 2020-09-23 00:00:00.000000000 Z
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.0.0
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.0.0
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.11.0
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.11.0
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.10
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.10
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.1.2
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: []