spree_core 4.0.8 → 4.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree.js +0 -1
  3. data/app/finders/spree/products/find.rb +19 -6
  4. data/app/finders/spree/variants/option_types_finder.rb +21 -0
  5. data/app/finders/spree/variants/visible_finder.rb +22 -0
  6. data/app/helpers/spree/base_helper.rb +48 -18
  7. data/app/helpers/spree/products_helper.rb +76 -8
  8. data/app/models/concerns/spree/user_methods.rb +2 -2
  9. data/app/models/spree/app_dependencies.rb +1 -7
  10. data/app/models/spree/credit_card.rb +4 -5
  11. data/app/models/spree/image/configuration/active_storage.rb +9 -1
  12. data/app/models/spree/image.rb +52 -3
  13. data/app/models/spree/line_item.rb +1 -2
  14. data/app/models/spree/option_type.rb +4 -0
  15. data/app/models/spree/order/address_book.rb +20 -7
  16. data/app/models/spree/order.rb +12 -12
  17. data/app/models/spree/payment_method.rb +8 -0
  18. data/app/models/spree/preferences/preferable.rb +1 -1
  19. data/app/models/spree/product.rb +7 -6
  20. data/app/models/spree/promotion/actions/create_item_adjustments.rb +1 -1
  21. data/app/models/spree/promotion_handler/coupon.rb +2 -1
  22. data/app/models/spree/return_item/eligibility_validator/base_validator.rb +1 -1
  23. data/app/models/spree/store.rb +2 -1
  24. data/app/models/spree/taxon.rb +2 -6
  25. data/app/models/spree/variant.rb +2 -14
  26. data/app/models/spree/zone.rb +6 -3
  27. data/app/presenters/spree/product_summary_presenter.rb +26 -0
  28. data/app/presenters/spree/variant_presenter.rb +69 -0
  29. data/app/presenters/spree/variants/option_types_presenter.rb +74 -0
  30. data/app/presenters/spree/variants/options_presenter.rb +49 -0
  31. data/app/services/spree/checkout/get_shipping_rates.rb +10 -7
  32. data/app/services/spree/checkout/update.rb +2 -13
  33. data/config/locales/en.yml +156 -14
  34. data/db/default/spree/stores.rb +8 -3
  35. data/db/migrate/20140309033438_create_store_from_preferences.rb +8 -4
  36. data/db/migrate/20191005121504_add_store_id_to_payment_methods.rb +7 -0
  37. data/db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb +5 -0
  38. data/db/migrate/20200102141311_add_social_to_spree_stores.rb +7 -0
  39. data/lib/generators/spree/dummy/dummy_generator.rb +3 -1
  40. data/lib/generators/spree/dummy/templates/initializers/bullet.rb +5 -0
  41. data/lib/generators/spree/install/install_generator.rb +13 -5
  42. data/lib/generators/spree/install/templates/config/initializers/spree.rb +0 -1
  43. data/lib/generators/spree/install/templates/config/initializers/spree_storefront.rb +1 -0
  44. data/lib/generators/spree/install/templates/config/spree_storefront.yml +67 -0
  45. data/lib/spree/core/controller_helpers/order.rb +12 -6
  46. data/lib/spree/core/controller_helpers/store.rb +2 -2
  47. data/lib/spree/core/search/base.rb +59 -22
  48. data/lib/spree/core/version.rb +1 -3
  49. data/lib/spree/core.rb +0 -1
  50. data/lib/spree/money.rb +8 -1
  51. data/lib/spree/permitted_attributes.rb +3 -2
  52. data/lib/spree/testing_support/capybara_ext.rb +0 -52
  53. data/lib/spree/testing_support/common_rake.rb +1 -1
  54. data/lib/spree/testing_support/factories/store_factory.rb +3 -0
  55. data/lib/spree/testing_support/order_walkthrough.rb +7 -3
  56. data/spree_core.gemspec +9 -15
  57. metadata +49 -34
  58. data/app/finders/spree/addresses/find.rb +0 -17
  59. data/app/services/spree/account/addresses/base.rb +0 -39
  60. data/app/services/spree/account/addresses/create.rb +0 -18
  61. data/app/services/spree/account/addresses/update.rb +0 -18
  62. data/lib/spree/database_type_utilities.rb +0 -12
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.0.8
4
+ version: 4.1.0.rc1
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: 2021-05-31 00:00:00.000000000 Z
11
+ date: 2020-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -144,16 +144,22 @@ dependencies:
144
144
  name: kaminari
145
145
  requirement: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - "~>"
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: 1.0.1
150
+ - - "<"
148
151
  - !ruby/object:Gem::Version
149
- version: 1.2.1
152
+ version: 1.2.0
150
153
  type: :runtime
151
154
  prerelease: false
152
155
  version_requirements: !ruby/object:Gem::Requirement
153
156
  requirements:
154
- - - "~>"
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: 1.0.1
160
+ - - "<"
155
161
  - !ruby/object:Gem::Version
156
- version: 1.2.1
162
+ version: 1.2.0
157
163
  - !ruby/object:Gem::Dependency
158
164
  name: money
159
165
  requirement: !ruby/object:Gem::Requirement
@@ -214,22 +220,16 @@ dependencies:
214
220
  name: rails
215
221
  requirement: !ruby/object:Gem::Requirement
216
222
  requirements:
217
- - - ">="
218
- - !ruby/object:Gem::Version
219
- version: '5.2'
220
- - - "<"
223
+ - - "~>"
221
224
  - !ruby/object:Gem::Version
222
- version: '6.1'
225
+ version: 6.0.0
223
226
  type: :runtime
224
227
  prerelease: false
225
228
  version_requirements: !ruby/object:Gem::Requirement
226
229
  requirements:
227
- - - ">="
228
- - !ruby/object:Gem::Version
229
- version: '5.2'
230
- - - "<"
230
+ - - "~>"
231
231
  - !ruby/object:Gem::Version
232
- version: '6.1'
232
+ version: 6.0.0
233
233
  - !ruby/object:Gem::Dependency
234
234
  name: ransack
235
235
  requirement: !ruby/object:Gem::Requirement
@@ -304,16 +304,22 @@ dependencies:
304
304
  name: twitter_cldr
305
305
  requirement: !ruby/object:Gem::Requirement
306
306
  requirements:
307
- - - "~>"
307
+ - - ">="
308
308
  - !ruby/object:Gem::Version
309
309
  version: '4.3'
310
+ - - "<"
311
+ - !ruby/object:Gem::Version
312
+ version: '6.0'
310
313
  type: :runtime
311
314
  prerelease: false
312
315
  version_requirements: !ruby/object:Gem::Requirement
313
316
  requirements:
314
- - - "~>"
317
+ - - ">="
315
318
  - !ruby/object:Gem::Version
316
319
  version: '4.3'
320
+ - - "<"
321
+ - !ruby/object:Gem::Version
322
+ version: '6.0'
317
323
  - !ruby/object:Gem::Dependency
318
324
  name: sprockets
319
325
  requirement: !ruby/object:Gem::Requirement
@@ -346,16 +352,22 @@ dependencies:
346
352
  name: mini_magick
347
353
  requirement: !ruby/object:Gem::Requirement
348
354
  requirements:
349
- - - "~>"
355
+ - - ">="
350
356
  - !ruby/object:Gem::Version
351
357
  version: 4.9.4
358
+ - - "<"
359
+ - !ruby/object:Gem::Version
360
+ version: 4.11.0
352
361
  type: :runtime
353
362
  prerelease: false
354
363
  version_requirements: !ruby/object:Gem::Requirement
355
364
  requirements:
356
- - - "~>"
365
+ - - ">="
357
366
  - !ruby/object:Gem::Version
358
367
  version: 4.9.4
368
+ - - "<"
369
+ - !ruby/object:Gem::Version
370
+ version: 4.11.0
359
371
  - !ruby/object:Gem::Dependency
360
372
  name: image_processing
361
373
  requirement: !ruby/object:Gem::Requirement
@@ -400,7 +412,6 @@ files:
400
412
  - app/assets/images/noimage/small.png
401
413
  - app/assets/javascripts/spree.js
402
414
  - app/controllers/spree/base_controller.rb
403
- - app/finders/spree/addresses/find.rb
404
415
  - app/finders/spree/countries/find.rb
405
416
  - app/finders/spree/credit_cards/find.rb
406
417
  - app/finders/spree/line_items/find_by_variant.rb
@@ -408,6 +419,8 @@ files:
408
419
  - app/finders/spree/orders/find_current.rb
409
420
  - app/finders/spree/products/find.rb
410
421
  - app/finders/spree/taxons/find.rb
422
+ - app/finders/spree/variants/option_types_finder.rb
423
+ - app/finders/spree/variants/visible_finder.rb
411
424
  - app/helpers/spree/base_helper.rb
412
425
  - app/helpers/spree/products_helper.rb
413
426
  - app/mailers/spree/base_mailer.rb
@@ -607,9 +620,10 @@ files:
607
620
  - app/models/spree/zone.rb
608
621
  - app/models/spree/zone_member.rb
609
622
  - app/paginators/spree/shared/paginate.rb
610
- - app/services/spree/account/addresses/base.rb
611
- - app/services/spree/account/addresses/create.rb
612
- - app/services/spree/account/addresses/update.rb
623
+ - app/presenters/spree/product_summary_presenter.rb
624
+ - app/presenters/spree/variant_presenter.rb
625
+ - app/presenters/spree/variants/option_types_presenter.rb
626
+ - app/presenters/spree/variants/options_presenter.rb
613
627
  - app/services/spree/cart/add_item.rb
614
628
  - app/services/spree/cart/create.rb
615
629
  - app/services/spree/cart/estimate_shipping_rates.rb
@@ -928,6 +942,9 @@ files:
928
942
  - db/migrate/20181024100754_add_deleted_at_to_spree_credit_cards.rb
929
943
  - db/migrate/20190305121659_add_iso_and_iso3_validation_on_presence_and_uniqueness.rb
930
944
  - db/migrate/20190523092729_add_user_id_and_deleted_at_to_spree_addresses.rb
945
+ - db/migrate/20191005121504_add_store_id_to_payment_methods.rb
946
+ - db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb
947
+ - db/migrate/20200102141311_add_social_to_spree_stores.rb
931
948
  - db/seeds.rb
932
949
  - lib/friendly_id/slug_rails5_patch.rb
933
950
  - lib/generators/spree/custom_user/custom_user_generator.rb
@@ -935,6 +952,7 @@ files:
935
952
  - lib/generators/spree/custom_user/templates/initializer.rb.tt
936
953
  - lib/generators/spree/custom_user/templates/migration.rb.tt
937
954
  - lib/generators/spree/dummy/dummy_generator.rb
955
+ - lib/generators/spree/dummy/templates/initializers/bullet.rb
938
956
  - lib/generators/spree/dummy/templates/initializers/devise.rb
939
957
  - lib/generators/spree/dummy/templates/rails/application.rb
940
958
  - lib/generators/spree/dummy/templates/rails/boot.rb
@@ -947,6 +965,8 @@ files:
947
965
  - lib/generators/spree/dummy_model/templates/model.rb.tt
948
966
  - lib/generators/spree/install/install_generator.rb
949
967
  - lib/generators/spree/install/templates/config/initializers/spree.rb
968
+ - lib/generators/spree/install/templates/config/initializers/spree_storefront.rb
969
+ - lib/generators/spree/install/templates/config/spree_storefront.yml
950
970
  - lib/generators/spree/install/templates/vendor/assets/javascripts/spree/backend/all.js
951
971
  - lib/generators/spree/install/templates/vendor/assets/javascripts/spree/frontend/all.js
952
972
  - lib/generators/spree/install/templates/vendor/assets/stylesheets/spree/backend/all.css
@@ -975,7 +995,6 @@ files:
975
995
  - lib/spree/core/search/base.rb
976
996
  - lib/spree/core/token_generator.rb
977
997
  - lib/spree/core/version.rb
978
- - lib/spree/database_type_utilities.rb
979
998
  - lib/spree/dependencies_helper.rb
980
999
  - lib/spree/i18n.rb
981
1000
  - lib/spree/i18n/base.rb
@@ -1067,12 +1086,8 @@ files:
1067
1086
  homepage: http://spreecommerce.org
1068
1087
  licenses:
1069
1088
  - BSD-3-Clause
1070
- metadata:
1071
- bug_tracker_uri: https://github.com/spree/spree/issues
1072
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.0.8
1073
- documentation_uri: https://guides.spreecommerce.org/
1074
- source_code_uri: https://github.com/spree/spree/tree/v4.0.8
1075
- post_install_message:
1089
+ metadata: {}
1090
+ post_install_message:
1076
1091
  rdoc_options: []
1077
1092
  require_paths:
1078
1093
  - lib
@@ -1087,8 +1102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1087
1102
  - !ruby/object:Gem::Version
1088
1103
  version: 1.8.23
1089
1104
  requirements: []
1090
- rubygems_version: 3.2.3
1091
- signing_key:
1105
+ rubygems_version: 3.0.3
1106
+ signing_key:
1092
1107
  specification_version: 4
1093
1108
  summary: The bare bones necessary for Spree.
1094
1109
  test_files: []
@@ -1,17 +0,0 @@
1
- module Spree
2
- module Addresses
3
- class Find
4
- def initialize(scope:, params:)
5
- @scope = scope
6
- end
7
-
8
- def execute
9
- scope
10
- end
11
-
12
- private
13
-
14
- attr_reader :scope
15
- end
16
- end
17
- end
@@ -1,39 +0,0 @@
1
- module Spree
2
- module Account
3
- module Addresses
4
- class Base
5
- prepend Spree::ServiceModule::Base
6
-
7
- private
8
-
9
- attr_accessor :country
10
-
11
- def fill_country_and_state_ids(params)
12
- replace_country_iso_with_id(params)
13
- fill_state_id(params)
14
- end
15
-
16
- def replace_country_iso_with_id(params)
17
- iso = params[:country_iso]
18
- return params unless iso.present?
19
-
20
- country = Spree::Country.by_iso(iso)
21
- params[:country_id] = country&.id
22
- params.delete(:country_iso)
23
- params
24
- end
25
-
26
- def fill_state_id(params)
27
- state_name = params[:state_name]
28
- return params unless state_name.present?
29
-
30
- country ||= Spree::Country.find(params[:country_id]) if params[:country_id].present?
31
- return params unless country
32
-
33
- params[:state_id] = country.states.find_by(name: state_name)&.id
34
- params
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,18 +0,0 @@
1
- module Spree
2
- module Account
3
- module Addresses
4
- class Create < ::Spree::Account::Addresses::Base
5
- def call(user:, address_params:)
6
- fill_country_and_state_ids(address_params)
7
-
8
- address = user.addresses.new(address_params)
9
- if address.save
10
- success(address)
11
- else
12
- failure(address)
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end
@@ -1,18 +0,0 @@
1
- module Spree
2
- module Account
3
- module Addresses
4
- class Update < ::Spree::Account::Addresses::Base
5
- def call(address:, address_params:)
6
- address_params[:country_id] ||= address.country_id
7
- fill_country_and_state_ids(address_params)
8
-
9
- if address.update(address_params)
10
- success(address)
11
- else
12
- failure(address)
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end
@@ -1,12 +0,0 @@
1
- module Spree
2
- module DatabaseTypeUtilities
3
- def self.maximum_value_for(data_type)
4
- case data_type
5
- when :integer
6
- ActiveModel::Type::Integer.new.instance_eval { range.max }
7
- else
8
- raise ArgumentError.new('Currently only :integer argument is acceptable')
9
- end
10
- end
11
- end
12
- end