spree_core 3.7.14.1 → 4.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/app/controllers/spree/base_controller.rb +0 -1
  4. data/app/finders/spree/taxons/find.rb +6 -5
  5. data/app/helpers/spree/base_helper.rb +0 -9
  6. data/app/helpers/spree/products_helper.rb +1 -1
  7. data/app/models/concerns/spree/product_scopes.rb +254 -0
  8. data/app/models/concerns/spree/user_address.rb +5 -2
  9. data/app/models/friendly_id/slug_decorator.rb +8 -2
  10. data/app/models/spree/ability.rb +21 -22
  11. data/app/models/spree/address.rb +37 -24
  12. data/app/models/spree/adjustment.rb +0 -10
  13. data/app/models/spree/app_dependencies.rb +2 -2
  14. data/app/models/spree/asset.rb +1 -12
  15. data/app/models/spree/country.rb +2 -2
  16. data/app/models/spree/credit_card.rb +4 -5
  17. data/app/models/spree/gateway/bogus.rb +1 -1
  18. data/app/models/spree/image.rb +8 -1
  19. data/app/models/spree/image/configuration/active_storage.rb +0 -2
  20. data/app/models/spree/order.rb +13 -78
  21. data/app/models/spree/order/address_book.rb +86 -0
  22. data/app/models/spree/order/checkout.rb +4 -22
  23. data/app/models/spree/order/currency_updater.rb +1 -1
  24. data/app/models/spree/order/store_credit.rb +0 -18
  25. data/app/models/spree/order_merger.rb +1 -0
  26. data/app/models/spree/payment.rb +4 -2
  27. data/app/models/spree/payment/gateway_options.rb +1 -1
  28. data/app/models/spree/payment/processing.rb +2 -0
  29. data/app/models/spree/preferences/configuration.rb +1 -1
  30. data/app/models/spree/preferences/preferable.rb +1 -1
  31. data/app/models/spree/product.rb +2 -3
  32. data/app/models/spree/promotion_handler/coupon.rb +2 -1
  33. data/app/models/spree/reimbursement_tax_calculator.rb +1 -1
  34. data/app/models/spree/return_item.rb +1 -1
  35. data/app/models/spree/return_item/eligibility_validator/default.rb +2 -0
  36. data/app/models/spree/return_item/eligibility_validator/{rma_required.rb → r_m_a_required.rb} +0 -0
  37. data/app/models/spree/shipment.rb +1 -1
  38. data/app/models/spree/store_credit.rb +4 -5
  39. data/app/models/spree/taxon_image.rb +1 -1
  40. data/app/models/spree/taxonomy.rb +1 -1
  41. data/app/services/spree/cart/add_item.rb +3 -1
  42. data/app/services/spree/cart/update.rb +1 -1
  43. data/config/locales/en.yml +15 -0
  44. data/db/default/spree/stores.rb +1 -0
  45. data/db/default/spree/zones.rb +16 -0
  46. data/db/migrate/20140806144901_add_type_to_reimbursement_type.rb +1 -1
  47. data/db/migrate/20141101231208_fix_adjustment_order_presence.rb +2 -2
  48. data/db/migrate/20170323151450_add_missing_unique_indexes_for_unique_attributes.rb +1 -1
  49. data/db/migrate/20190305121659_add_iso_and_iso3_validation_on_presence_and_uniqueness.rb +18 -0
  50. data/db/migrate/20190523092729_add_user_id_and_deleted_at_to_spree_addresses.rb +12 -0
  51. data/lib/generators/spree/dummy/dummy_generator.rb +3 -1
  52. data/lib/spree/core.rb +0 -2
  53. data/lib/spree/core/importer/order.rb +64 -103
  54. data/lib/spree/core/importer/product.rb +2 -2
  55. data/lib/spree/core/product_duplicator.rb +1 -5
  56. data/lib/spree/core/version.rb +1 -3
  57. data/lib/spree/permitted_attributes.rb +3 -1
  58. data/lib/spree/testing_support/ability_helpers.rb +3 -11
  59. data/lib/spree/testing_support/capybara_config.rb +4 -1
  60. data/lib/spree/testing_support/capybara_ext.rb +22 -98
  61. data/lib/spree/testing_support/controller_requests.rb +36 -26
  62. data/lib/spree/testing_support/factories/image_factory.rb +2 -6
  63. data/lib/spree/testing_support/factories/return_item_factory.rb +2 -2
  64. data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
  65. data/lib/spree/testing_support/i18n.rb +6 -8
  66. data/lib/spree/testing_support/image_helpers.rb +5 -11
  67. data/lib/tasks/exchanges.rake +35 -37
  68. data/spree_core.gemspec +11 -14
  69. metadata +63 -103
  70. data/app/models/concerns/spree/acts_as_taggable.rb +0 -11
  71. data/app/models/spree/image/configuration/paperclip.rb +0 -64
  72. data/app/models/spree/order_contents.rb +0 -54
  73. data/app/models/spree/product/scopes.rb +0 -250
  74. data/app/models/spree/tag.rb +0 -4
  75. data/app/models/spree/taxon_image/configuration/paperclip.rb +0 -27
  76. data/config/initializers/acts_as_taggable_on.rb +0 -9
  77. data/config/initializers/use_paperclip.rb +0 -3
  78. data/db/migrate/20160511071954_acts_as_taggable_on_spree_migration.rb +0 -40
  79. data/db/migrate/20160511072249_change_collation_for_spree_tag_names.rb +0 -9
  80. data/db/migrate/20160511072335_add_missing_indexes_to_spree_taggings.rb +0 -14
  81. data/lib/spree/core/controller_helpers/respond_with.rb +0 -67
  82. data/lib/spree/responder.rb +0 -44
  83. data/lib/spree/testing_support/factories/tag_factory.rb +0 -5
@@ -26,11 +26,11 @@ module Spree
26
26
  end
27
27
 
28
28
  def update
29
- if product.update_attributes(product_attrs)
29
+ if product.update(product_attrs)
30
30
  variants_attrs.each do |variant_attribute|
31
31
  # update the variant if the id is present in the payload
32
32
  if variant_attribute['id'].present?
33
- product.variants.find(variant_attribute['id'].to_i).update_attributes(variant_attribute)
33
+ product.variants.find(variant_attribute['id'].to_i).update(variant_attribute)
34
34
  else
35
35
  # make sure the product is assigned before the options=
36
36
  product.variants.create({ product: product }.merge(variant_attribute))
@@ -58,11 +58,7 @@ module Spree
58
58
 
59
59
  def duplicate_image(image)
60
60
  new_image = image.dup
61
- if Rails.application.config.use_paperclip
62
- new_image.assign_attributes(attachment: image.attachment.clone)
63
- else
64
- new_image.attachment.attach(image.attachment.blob)
65
- end
61
+ new_image.attachment.attach(image.attachment.blob)
66
62
  new_image.save!
67
63
  new_image
68
64
  end
@@ -1,7 +1,5 @@
1
1
  module Spree
2
- VERSION = '3.7.14.1'.freeze
3
-
4
2
  def self.version
5
- VERSION
3
+ '4.0.0.beta'
6
4
  end
7
5
  end
@@ -33,12 +33,14 @@ module Spree
33
33
  :id, :firstname, :lastname, :first_name, :last_name,
34
34
  :address1, :address2, :city, :country_iso, :country_id, :state_id,
35
35
  :zipcode, :phone, :state_name, :alternative_phone, :company,
36
+ :user_id, :deleted_at,
36
37
  country: [:iso, :name, :iso3, :iso_name],
37
38
  state: [:name, :abbr]
38
39
  ]
39
40
 
40
41
  @@checkout_attributes = [
41
- :coupon_code, :email, :shipping_method_id, :special_instructions, :use_billing, :user_id
42
+ :coupon_code, :email, :shipping_method_id, :special_instructions, :use_billing,
43
+ :user_id, :bill_address_id, :ship_address_id
42
44
  ]
43
45
 
44
46
  @@customer_return_attributes = [:stock_location_id, return_items_attributes: [:id, :inventory_unit_id, :return_authorization_id, :returned, :pre_tax_amount, :acceptance_status, :exchange_variant_id, :resellable]]
@@ -1,7 +1,7 @@
1
1
  shared_examples_for 'access granted' do
2
- it 'should allow read' do
3
- expect(ability).to be_able_to(:read, resource, token) if token
4
- expect(ability).to be_able_to(:read, resource) unless token
2
+ it 'should allow show' do
3
+ expect(ability).to be_able_to(:show, resource, token) if token
4
+ expect(ability).to be_able_to(:show, resource) unless token
5
5
  end
6
6
 
7
7
  it 'should allow create' do
@@ -66,10 +66,6 @@ shared_examples_for 'create only' do
66
66
  it 'should not allow update' do
67
67
  expect(ability).to_not be_able_to(:update, resource)
68
68
  end
69
-
70
- it 'should not allow index' do
71
- expect(ability).to_not be_able_to(:index, resource)
72
- end
73
69
  end
74
70
 
75
71
  shared_examples_for 'read only' do
@@ -98,8 +94,4 @@ shared_examples_for 'update only' do
98
94
  it 'should allow update' do
99
95
  expect(ability).to be_able_to(:update, resource)
100
96
  end
101
-
102
- it 'should not allow index' do
103
- expect(ability).to_not be_able_to(:index, resource)
104
- end
105
97
  end
@@ -7,10 +7,12 @@ if ENV['WEBDRIVER'] == 'accessible'
7
7
  Capybara.javascript_driver = :accessible
8
8
  else
9
9
  Capybara.register_driver :chrome do |app|
10
+ Selenium::WebDriver.logger.level = :error
11
+
10
12
  Capybara::Selenium::Driver.new app,
11
13
  browser: :chrome,
12
14
  options: Selenium::WebDriver::Chrome::Options.new(
13
- args: %w[disable-popup-blocking headless disable-gpu window-size=1920,1080],
15
+ args: %w[no-sandbox disable-dev-shm-usage disable-popup-blocking headless disable-gpu window-size=1920,1080 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=VizDisplayCompositor],
14
16
  log_level: :error
15
17
  )
16
18
  end
@@ -21,3 +23,4 @@ else
21
23
  end
22
24
  end
23
25
  Capybara.default_max_wait_time = 45
26
+ Capybara.server = :webrick
@@ -1,7 +1,11 @@
1
1
  module CapybaraExt
2
2
  # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1771
3
- def native_fill_in(selector, text)
4
- text.to_s.split('').each { |char| find_field(selector).native.send_keys(char) }
3
+ def delayed_fill_in(selector, text)
4
+ field = find_field(selector)
5
+ text.to_s.split('').each do |char|
6
+ sleep 0.05
7
+ field.send_keys(char)
8
+ end
5
9
  end
6
10
 
7
11
  def page!
@@ -9,19 +13,14 @@ module CapybaraExt
9
13
  end
10
14
 
11
15
  def click_icon(type)
12
- find(".icon-#{type}").click
13
- end
14
-
15
- def eventually_fill_in(field, options = {})
16
- expect(page).to have_css('#' + field)
17
- fill_in field, options
16
+ first(".icon-#{type}").click
18
17
  end
19
18
 
20
19
  def within_row(num, &block)
21
20
  if RSpec.current_example.metadata[:js]
22
- within("table.table tbody tr:nth-child(#{num})", &block)
21
+ within("table.table tbody tr:nth-child(#{num})", match: :first, &block)
23
22
  else
24
- within(:xpath, all('table.table tbody tr')[num - 1].path, &block)
23
+ within(all('table.table tbody tr')[num - 1], &block)
25
24
  end
26
25
  end
27
26
 
@@ -33,31 +32,29 @@ module CapybaraExt
33
32
  end
34
33
  end
35
34
 
36
- def set_select2_field(field, value)
37
- page.execute_script %Q{$('#{field}').select2('val', '#{value}')}
38
- end
39
-
40
35
  def select2_search(value, options)
41
- label = find_label_by_text(options[:from])
42
- within label.first(:xpath, './/..') do
43
- options[:from] = "##{find('.select2-container')['id']}"
44
- end
36
+ options[:from] = select2_from_label(options[:from])
45
37
  targetted_select2_search(value, options)
46
38
  end
47
39
 
48
40
  def targetted_select2_search(value, options)
49
- page.execute_script %Q{$('#{options[:from]}').select2('open')}
50
- page.execute_script "$('#{options[:dropdown_css]} input.select2-input').val('#{value}').trigger('keyup-change');"
41
+ select2_el = find(:css, options[:from])
42
+ select2_el.click
43
+ page.document.find('.select2-search input.select2-input,
44
+ .select2-search-field input.select2-input.select2-focused').send_keys(value)
51
45
  select_select2_result(value)
52
46
  end
53
47
 
54
48
  def select2(value, options)
55
- label = find_label_by_text(options[:from])
49
+ options[:from] = select2_from_label(options[:from])
50
+ targetted_select2(value, options)
51
+ end
56
52
 
53
+ def select2_from_label(from)
54
+ label = find(:label, from, class: '!select2-offscreen')
57
55
  within label.first(:xpath, './/..') do
58
- options[:from] = "##{find('.select2-container')['id']}"
56
+ "##{find('.select2-container')['id']}"
59
57
  end
60
- targetted_select2(value, options)
61
58
  end
62
59
 
63
60
  def select2_no_label(value, options = {})
@@ -77,29 +74,7 @@ module CapybaraExt
77
74
 
78
75
  def select_select2_result(value)
79
76
  # results are in a div appended to the end of the document
80
- within(:xpath, '//body') do
81
- page.find('div.select2-result-label', text: %r{#{Regexp.escape(value)}}i).click
82
- end
83
- end
84
-
85
- def find_label_by_text(text)
86
- label = find_label(text)
87
- counter = 0
88
-
89
- # Because JavaScript testing is prone to errors...
90
- while label.nil? && counter < 10
91
- sleep(1)
92
- counter += 1
93
- label = find_label(text)
94
- end
95
-
96
- raise "Could not find label by text #{text}" if label.nil?
97
-
98
- label
99
- end
100
-
101
- def find_label(text)
102
- first(:xpath, "//label[text()[contains(.,'#{text}')]]")
77
+ page.document.find('div.select2-result-label', match: :first, text: %r{#{Regexp.escape(value)}}i).click
103
78
  end
104
79
 
105
80
  # arg delay in seconds
@@ -110,11 +85,6 @@ module CapybaraExt
110
85
  end
111
86
  end
112
87
 
113
- # "Intelligiently" wait on condition
114
- #
115
- # Much better than a random sleep "here and there"
116
- # it will not cause any delay in case the condition is fullfilled on first cycle.
117
-
118
88
  def wait_for_condition(delay = Capybara.default_max_wait_time)
119
89
  counter = 0
120
90
  delay_threshold = delay * 10
@@ -125,40 +95,9 @@ module CapybaraExt
125
95
  end
126
96
  end
127
97
 
128
- def dismiss_alert
129
- page.evaluate_script('window.confirm = function() { return false; }')
130
- yield
131
- # Restore existing default
132
- page.evaluate_script('window.confirm = function() { return true; }')
133
- end
134
-
135
- def spree_accept_alert
136
- yield
137
- rescue Selenium::WebDriver::Error::UnhandledAlertError, Selenium::WebDriver::Error::NoSuchAlertError
138
- Selenium::WebDriver::Wait.new(timeout: 5)
139
- .until { page.driver.browser.switch_to.alert }
140
- .accept
141
- end
142
-
143
98
  def disable_html5_validation
144
99
  page.execute_script('for(var f=document.forms,i=f.length;i--;)f[i].setAttribute("novalidate",i)')
145
100
  end
146
-
147
- def handle_js_confirm(accept = true)
148
- page.evaluate_script 'window.original_confirm_function = window.confirm'
149
- page.evaluate_script "window.confirm = function(msg) { return #{accept}; }"
150
- yield
151
- ensure
152
- page.evaluate_script 'window.confirm = window.original_confirm_function'
153
- end
154
- end
155
-
156
- def wait_for(options = {})
157
- default_options = { error: nil, seconds: 5 }.merge(options)
158
-
159
- Selenium::WebDriver::Wait.new(timeout: default_options[:seconds]).until { yield }
160
- rescue Selenium::WebDriver::Error::TimeOutError
161
- default_options[:error].nil? ? false : raise(default_options[:error])
162
101
  end
163
102
 
164
103
  def wait_for(options = {})
@@ -170,7 +109,7 @@ rescue Selenium::WebDriver::Error::TimeOutError
170
109
  end
171
110
 
172
111
  Capybara.configure do |config|
173
- config.match = :prefer_exact
112
+ config.match = :smart
174
113
  config.ignore_hidden_elements = true
175
114
  end
176
115
 
@@ -189,21 +128,6 @@ RSpec::Matchers.define :have_meta do |name, expected|
189
128
  end
190
129
  end
191
130
 
192
- RSpec::Matchers.define :have_title do |expected|
193
- match do |_actual|
194
- has_css?('title', text: expected, visible: false)
195
- end
196
-
197
- failure_message do |actual|
198
- actual = first('title')
199
- if actual
200
- "expected that title would have been '#{expected}' but was '#{actual.text}'"
201
- else
202
- "expected that title would exist with '#{expected}'"
203
- end
204
- end
205
- end
206
-
207
131
  RSpec.configure do |c|
208
132
  c.include CapybaraExt
209
133
  end
@@ -1,28 +1,3 @@
1
- # Use this module to easily test Spree actions within Spree components
2
- # or inside your application to test routes for the mounted Spree engine.
3
- #
4
- # Inside your spec_helper.rb, include this module inside the RSpec.configure
5
- # block by doing this:
6
- #
7
- # require 'spree/testing_support/controller_requests'
8
- # RSpec.configure do |c|
9
- # c.include Spree::TestingSupport::ControllerRequests, type: :controller
10
- # end
11
- #
12
- # Then, in your controller tests, you can access spree routes like this:
13
- #
14
- # require 'spec_helper'
15
- #
16
- # describe Spree::ProductsController do
17
- # it "can see all the products" do
18
- # spree_get :index
19
- # end
20
- # end
21
- #
22
- # Use spree_get, spree_post, spree_put or spree_delete to make requests
23
- # to the Spree engine, and use regular get, post, put or delete to make
24
- # requests to your application.
25
- #
26
1
  module Spree
27
2
  module TestingSupport
28
3
  module ControllerRequests
@@ -33,46 +8,81 @@ module Spree
33
8
  end
34
9
 
35
10
  def spree_get(action, parameters = nil, session = nil, flash = nil)
11
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
12
+ ControllerRequests#spree_get is deprecated and will be removed in Spree 4.1.
13
+ Please use get, params: {}
14
+ DEPRECATION
36
15
  process_spree_action(action, parameters, session, flash, 'GET')
37
16
  end
38
17
 
39
18
  # Executes a request simulating POST HTTP method and set/volley the response
40
19
  def spree_post(action, parameters = nil, session = nil, flash = nil)
20
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
21
+ ControllerRequests#spree_post is deprecated and will be removed in Spree 4.1.
22
+ Please use post, params: {}
23
+ DEPRECATION
41
24
  process_spree_action(action, parameters, session, flash, 'POST')
42
25
  end
43
26
 
44
27
  # Executes a request simulating PUT HTTP method and set/volley the response
45
28
  def spree_put(action, parameters = nil, session = nil, flash = nil)
29
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
30
+ ControllerRequests#spree_put is deprecated and will be removed in Spree 4.1.
31
+ Please use put, params: {}
32
+ DEPRECATION
46
33
  process_spree_action(action, parameters, session, flash, 'PUT')
47
34
  end
48
35
 
49
- # Executes a request simulating PATCH HTTP method and set/volley the response
36
+ # # Executes a request simulating PATCH HTTP method and set/volley the response
50
37
  def spree_patch(action, parameters = nil, session = nil, flash = nil)
38
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
39
+ ControllerRequests#spree_patch is deprecated and will be removed in Spree 4.1.
40
+ Please use patch, params: {}
41
+ DEPRECATION
51
42
  process_spree_action(action, parameters, session, flash, 'PATCH')
52
43
  end
53
44
 
54
45
  # Executes a request simulating DELETE HTTP method and set/volley the response
55
46
  def spree_delete(action, parameters = nil, session = nil, flash = nil)
47
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
48
+ ControllerRequests#spree_delete is deprecated and will be removed in Spree 4.1.
49
+ Please use delete, params: {}
50
+ DEPRECATION
56
51
  process_spree_action(action, parameters, session, flash, 'DELETE')
57
52
  end
58
53
 
59
54
  def spree_xhr_get(action, parameters = nil, session = nil, flash = nil)
55
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
56
+ ControllerRequests#spree_xhr_get is deprecated and will be removed in Spree 4.1.
57
+ DEPRECATION
60
58
  process_spree_xhr_action(action, parameters, session, flash, :get)
61
59
  end
62
60
 
63
61
  def spree_xhr_post(action, parameters = nil, session = nil, flash = nil)
62
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
63
+ ControllerRequests#spree_xhr_post is deprecated and will be removed in Spree 4.1.
64
+ DEPRECATION
64
65
  process_spree_xhr_action(action, parameters, session, flash, :post)
65
66
  end
66
67
 
67
68
  def spree_xhr_put(action, parameters = nil, session = nil, flash = nil)
69
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
70
+ ControllerRequests#spree_xhr_put is deprecated and will be removed in Spree 4.1.
71
+ DEPRECATION
68
72
  process_spree_xhr_action(action, parameters, session, flash, :put)
69
73
  end
70
74
 
71
75
  def spree_xhr_patch(action, parameters = nil, session = nil, flash = nil)
76
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
77
+ ControllerRequests#spree_xhr_patch is deprecated and will be removed in Spree 4.1.
78
+ DEPRECATION
72
79
  process_spree_xhr_action(action, parameters, session, flash, :patch)
73
80
  end
74
81
 
75
82
  def spree_xhr_delete(action, parameters = nil, session = nil, flash = nil)
83
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
84
+ ControllerRequests#spree_xhr_delete is deprecated and will be removed in Spree 4.1.
85
+ DEPRECATION
76
86
  process_spree_xhr_action(action, parameters, session, flash, :delete)
77
87
  end
78
88
 
@@ -1,11 +1,7 @@
1
1
  FactoryBot.define do
2
2
  factory :image, class: Spree::Image do
3
- if Rails.application.config.use_paperclip
4
- attachment { File.new(Spree::Core::Engine.root + 'spec/fixtures' + 'thinking-cat.jpg') }
5
- else
6
- before(:create) do |image|
7
- image.attachment.attach(io: File.new(Spree::Core::Engine.root + 'spec/fixtures' + 'thinking-cat.jpg'), filename: 'thinking-cat.jpg')
8
- end
3
+ before(:create) do |image|
4
+ image.attachment.attach(io: File.new(Spree::Core::Engine.root + 'spec/fixtures' + 'thinking-cat.jpg'), filename: 'thinking-cat.jpg')
9
5
  end
10
6
  end
11
7
  end
@@ -1,7 +1,7 @@
1
1
  FactoryBot.define do
2
2
  factory :return_item, class: Spree::ReturnItem do
3
- association(:inventory_unit, factory: :inventory_unit, state: :shipped)
4
- association(:return_authorization, factory: :return_authorization)
3
+ association(:inventory_unit, factory: :inventory_unit, state: :shipped, strategy: :create)
4
+ association(:return_authorization, factory: :return_authorization, strategy: :create)
5
5
 
6
6
  factory :exchange_return_item do
7
7
  after(:build) do |return_item|
@@ -1,7 +1,7 @@
1
1
  FactoryBot.define do
2
2
  factory :taxon, class: Spree::Taxon do
3
3
  sequence(:name) { |n| "taxon_#{n}" }
4
- taxonomy
4
+ association(:taxonomy, strategy: :create)
5
5
  parent_id { taxonomy.root.id }
6
6
  end
7
7
  end
@@ -32,14 +32,12 @@ module Spree
32
32
  root = translations
33
33
  processed_keys = []
34
34
  translation_keys.each do |key|
35
- begin
36
- root = root.fetch(key.to_sym)
37
- processed_keys << key.to_sym
38
- rescue KeyError
39
- error = "#{(processed_keys << key).join('.')} (#{I18n.locale})"
40
- unless Spree.missing_translation_messages.include?(error)
41
- Spree.missing_translation_messages << error
42
- end
35
+ root = root.fetch(key.to_sym)
36
+ processed_keys << key.to_sym
37
+ rescue KeyError
38
+ error = "#{(processed_keys << key).join('.')} (#{I18n.locale})"
39
+ unless Spree.missing_translation_messages.include?(error)
40
+ Spree.missing_translation_messages << error
43
41
  end
44
42
  end
45
43
  end