solidus_product_assembly 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +47 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/dependabot.yml +7 -0
  5. data/.github/stale.yml +17 -0
  6. data/.github_changelog_generator +2 -0
  7. data/.gitignore +18 -2
  8. data/.rspec +1 -2
  9. data/.rubocop.yml +7 -0
  10. data/.rubocop_todo.yml +316 -0
  11. data/CHANGELOG.md +116 -0
  12. data/Gemfile +36 -9
  13. data/LICENSE +26 -0
  14. data/README.md +75 -50
  15. data/Rakefile +4 -19
  16. data/app/controllers/spree/admin/parts_controller.rb +13 -11
  17. data/app/decorators/helpers/solidus_product_assembly/spree/admin/orders_helper_decorator.rb +19 -0
  18. data/app/decorators/models/solidus_product_assembly/spree/inventory_unit_decorator.rb +19 -0
  19. data/app/decorators/models/solidus_product_assembly/spree/line_item_decorator.rb +52 -0
  20. data/app/decorators/models/solidus_product_assembly/spree/product_decorator.rb +83 -0
  21. data/app/decorators/models/solidus_product_assembly/spree/return_item_decorator.rb +15 -0
  22. data/app/decorators/models/solidus_product_assembly/spree/shipment_decorator.rb +55 -0
  23. data/app/decorators/models/solidus_product_assembly/spree/stock/availability_validator_decorator.rb +37 -0
  24. data/app/decorators/models/solidus_product_assembly/spree/stock/differentiator_decorator.rb +17 -0
  25. data/app/decorators/models/solidus_product_assembly/spree/stock/inventory_unit_builder_decorator.rb +39 -0
  26. data/app/decorators/models/solidus_product_assembly/spree/stock/inventory_units_finalizer_decorator.rb +33 -0
  27. data/app/decorators/models/solidus_product_assembly/spree/stock/inventory_validator_decorator.rb +22 -0
  28. data/app/decorators/models/solidus_product_assembly/spree/variant_decorator.rb +26 -0
  29. data/app/models/spree/assemblies_part.rb +6 -4
  30. data/app/models/spree/calculator/returns/assemblies_default_refund_amount.rb +17 -0
  31. data/app/models/spree/order_inventory_assembly.rb +11 -2
  32. data/app/overrides/add_admin_product_form_fields.rb +7 -5
  33. data/app/overrides/add_admin_tabs.rb +7 -5
  34. data/app/overrides/add_line_item_description.rb +7 -5
  35. data/app/overrides/spree/admin/orders/_carton_manifest/_assembly_parts_price.html.erb.deface +9 -0
  36. data/app/overrides/spree/admin/orders/_carton_manifest/_assembly_parts_total_price.html.erb.deface +9 -0
  37. data/app/overrides/spree/admin/orders/_shipment/stock_contents.html.erb.deface +7 -1
  38. data/app/overrides/spree/products/show/add_links_to_parts.html.erb.deface +2 -2
  39. data/app/views/spree/admin/orders/_assemblies.html.erb +8 -17
  40. data/app/views/spree/admin/orders/_stock_contents.html.erb +2 -62
  41. data/app/views/spree/admin/orders/_stock_contents_2_3.html.erb +69 -0
  42. data/app/views/spree/admin/orders/_stock_contents_2_4.html.erb +70 -0
  43. data/app/views/spree/admin/orders/_stock_item.html.erb +13 -10
  44. data/app/views/spree/admin/parts/_parts_table.html.erb +17 -11
  45. data/app/views/spree/admin/parts/available.html.erb +10 -8
  46. data/app/views/spree/admin/parts/available.js.erb +9 -7
  47. data/app/views/spree/admin/parts/index.html.erb +1 -1
  48. data/app/views/spree/admin/products/_product_assembly_fields.html.erb +2 -2
  49. data/app/views/spree/admin/shared/_product_assembly_product_tabs.html.erb +1 -1
  50. data/app/views/spree/api/line_items/show.v1.rabl +27 -0
  51. data/app/views/spree/checkout/_line_item_manifest.html.erb +3 -1
  52. data/bin/console +17 -0
  53. data/bin/rails +5 -5
  54. data/bin/rails-engine +13 -0
  55. data/bin/rails-sandbox +16 -0
  56. data/bin/rake +7 -0
  57. data/bin/sandbox +86 -0
  58. data/bin/setup +8 -0
  59. data/config/routes.rb +2 -2
  60. data/db/migrate/20091028152124_add_many_to_many_relation_to_products.rb +7 -5
  61. data/db/migrate/20091029165620_add_parts_fields_to_products.rb +18 -16
  62. data/db/migrate/20120316141830_namespace_product_assembly_for_spree_one.rb +3 -1
  63. data/db/migrate/20140620223938_add_id_to_spree_assemblies_parts.rb +4 -2
  64. data/lib/generators/solidus_product_assembly/install/install_generator.rb +22 -9
  65. data/lib/generators/solidus_product_assembly/install/templates/initializer.rb +6 -0
  66. data/lib/solidus_product_assembly/configuration.rb +21 -0
  67. data/lib/solidus_product_assembly/engine.rb +12 -8
  68. data/lib/solidus_product_assembly/testing_support/factories.rb +4 -0
  69. data/lib/solidus_product_assembly/version.rb +3 -1
  70. data/lib/solidus_product_assembly.rb +7 -1
  71. data/lib/tasks/spree2_upgrade.rake +12 -12
  72. data/solidus_product_assembly.gemspec +35 -29
  73. data/spec/features/admin/orders_spec.rb +114 -16
  74. data/spec/features/admin/parts_spec.rb +5 -3
  75. data/spec/features/admin/return_items_spec.rb +151 -0
  76. data/spec/features/checkout_spec.rb +103 -21
  77. data/spec/models/spree/assemblies_part_spec.rb +3 -1
  78. data/spec/models/spree/inventory_unit_spec.rb +15 -6
  79. data/spec/models/spree/line_item_spec.rb +6 -4
  80. data/spec/models/spree/order_contents_spec.rb +6 -5
  81. data/spec/models/spree/order_inventory_assembly_spec.rb +8 -6
  82. data/spec/models/spree/order_inventory_spec.rb +7 -3
  83. data/spec/models/spree/product_spec.rb +33 -14
  84. data/spec/models/spree/shipment_spec.rb +20 -13
  85. data/spec/models/spree/stock/availability_validator_spec.rb +22 -33
  86. data/spec/models/spree/stock/coordinator_spec.rb +11 -3
  87. data/spec/models/spree/stock/inventory_unit_builder_spec.rb +5 -7
  88. data/spec/models/spree/variant_spec.rb +3 -1
  89. data/spec/spec_helper.rb +21 -45
  90. data/spec/support/shared_contexts/order_with_bundle.rb +2 -0
  91. metadata +80 -80
  92. data/.travis.yml +0 -21
  93. data/LICENSE.md +0 -13
  94. data/app/controllers/spree/checkout_controller_decorator.rb +0 -9
  95. data/app/helpers/spree/admin/orders_helper_decorator.rb +0 -9
  96. data/app/models/spree/inventory_unit_decorator.rb +0 -13
  97. data/app/models/spree/line_item_decorator.rb +0 -44
  98. data/app/models/spree/product_decorator.rb +0 -56
  99. data/app/models/spree/shipment_decorator.rb +0 -50
  100. data/app/models/spree/stock/availability_validator.rb +0 -28
  101. data/app/models/spree/stock/inventory_unit_builder_decorator.rb +0 -30
  102. data/app/models/spree/stock/inventory_validator_decorator.rb +0 -12
  103. data/app/models/spree/variant_decorator.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 89f3f4fbf3c8638a1d3a0eb8daeec71ab2e0be2c
4
- data.tar.gz: e67518d457ee0aa60495099b41e058b917f36472
2
+ SHA256:
3
+ metadata.gz: a19e2fc4629cafb8d296f9a5b8258500387ccd988b1eccd87b1ca8c49ce5ee97
4
+ data.tar.gz: 182ab4d194c7b42ce3a9303ae295172bddc7df08a4fd9d58f97f3f481b2d0247
5
5
  SHA512:
6
- metadata.gz: a4dae9aac9db62b23daca17315e84596f8da6421269ba816e8f17b6ac100e0c5916692d09e5f701c69b09972f65afe538fb231bd325bbf6e37690d48e8827c25
7
- data.tar.gz: ff2051e5a167ef6f1d4d7fce18d302baef6952e94f22df48115242ee5e9d9037170e93b99ab47e91ebd794e115dba79527db152c174ffd6f4659cdabcdb96003
6
+ metadata.gz: 35265dd9d72240d7bcab27f17856a1683e89d4ef31fe533fe048d3e80827f632bd5bac54fd6268b7d6f7c7a0075e9092758a9a2d3d2b13deeb4f969412b34a53
7
+ data.tar.gz: c3fd31fbb302b4335149014f953e0904aa81c119780bd4bfbb3e696cc9e9a8739b0818d409ac20b85abfef6efcdc9185839d6a9e696c573427ad71a1263b9316
@@ -0,0 +1,47 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ # Required for feature specs.
5
+ browser-tools: circleci/browser-tools@1.1
6
+
7
+ # Always take the latest version of the orb, this allows us to
8
+ # run specs against Solidus supported versions only without the need
9
+ # to change this configuration every time a Solidus version is released
10
+ # or goes EOL.
11
+ solidusio_extensions: solidusio/extensions@volatile
12
+
13
+ jobs:
14
+ run-specs-with-postgres:
15
+ executor: solidusio_extensions/postgres
16
+ steps:
17
+ - browser-tools/install-browser-tools
18
+ - solidusio_extensions/run-tests
19
+ run-specs-with-mysql:
20
+ executor: solidusio_extensions/mysql
21
+ steps:
22
+ - browser-tools/install-browser-tools
23
+ - solidusio_extensions/run-tests
24
+ lint-code:
25
+ executor: solidusio_extensions/sqlite-memory
26
+ steps:
27
+ - browser-tools/install-browser-tools
28
+ - solidusio_extensions/lint-code
29
+
30
+ workflows:
31
+ "Run specs on supported Solidus versions":
32
+ jobs:
33
+ - run-specs-with-postgres
34
+ - run-specs-with-mysql
35
+ - lint-code
36
+
37
+ "Weekly run specs against master":
38
+ triggers:
39
+ - schedule:
40
+ cron: "0 0 * * 4" # every Thursday
41
+ filters:
42
+ branches:
43
+ only:
44
+ - master
45
+ jobs:
46
+ - run-specs-with-postgres
47
+ - run-specs-with-mysql
data/.gem_release.yml ADDED
@@ -0,0 +1,5 @@
1
+ bump:
2
+ recurse: false
3
+ file: 'lib/solidus_product_assembly/version.rb'
4
+ message: Bump SolidusProductAssembly to %{version}
5
+ tag: true
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
data/.github/stale.yml ADDED
@@ -0,0 +1,17 @@
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 60
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: false
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - pinned
8
+ - security
9
+ # Label to use when marking an issue as stale
10
+ staleLabel: stale
11
+ # Comment to post when marking an issue as stale. Set to `false` to disable
12
+ markComment: >
13
+ This issue has been automatically marked as stale because it has not had
14
+ recent activity. It might be closed if no further activity occurs. Thank you
15
+ for your contributions.
16
+ # Comment to post when closing a stale issue. Set to `false` to disable
17
+ closeComment: false
@@ -0,0 +1,2 @@
1
+ issues=false
2
+ exclude-labels=infrastructure
data/.gitignore CHANGED
@@ -1,4 +1,20 @@
1
- spec/dummy
2
- Gemfile.lock
1
+ *.gem
2
+ \#*
3
+ *~
4
+ .#*
5
+ .DS_Store
6
+ .idea
7
+ .project
8
+ .sass-cache
3
9
  coverage
10
+ Gemfile.lock
11
+ tmp
12
+ nbproject
13
+ pkg
14
+ *.swp
15
+ spec/dummy
4
16
  spec/examples.txt
17
+ /sandbox
18
+ .rvmrc
19
+ .ruby-version
20
+ .ruby-gemset
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
1
  --color
2
- --format
3
- progress
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,7 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - solidus_dev_support/rubocop
5
+
6
+ AllCops:
7
+ NewCops: disable
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,316 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-09-14 16:19:15 UTC using RuboCop version 1.36.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemfile, **/Gemfile, **/gems.rb
13
+ Bundler/OrderedGems:
14
+ Exclude:
15
+ - 'Gemfile'
16
+
17
+ # Offense count: 2
18
+ # This cop supports safe autocorrection (--autocorrect).
19
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
20
+ # Include: **/*.gemspec
21
+ Gemspec/OrderedDependencies:
22
+ Exclude:
23
+ - 'solidus_product_assembly.gemspec'
24
+
25
+ # Offense count: 1
26
+ # Configuration parameters: Include.
27
+ # Include: **/*.gemspec
28
+ Gemspec/RequiredRubyVersion:
29
+ Exclude:
30
+ - 'solidus_product_assembly.gemspec'
31
+
32
+ # Offense count: 21
33
+ # This cop supports safe autocorrection (--autocorrect).
34
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
35
+ # SupportedStyles: with_first_argument, with_fixed_indentation
36
+ Layout/ArgumentAlignment:
37
+ Exclude:
38
+ - 'app/decorators/models/solidus_product_assembly/spree/product_decorator.rb'
39
+ - 'app/decorators/models/solidus_product_assembly/spree/shipment_decorator.rb'
40
+ - 'app/models/spree/assemblies_part.rb'
41
+ - 'app/overrides/add_admin_product_form_fields.rb'
42
+ - 'app/overrides/add_admin_tabs.rb'
43
+ - 'app/overrides/add_line_item_description.rb'
44
+
45
+ # Offense count: 2
46
+ # This cop supports safe autocorrection (--autocorrect).
47
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
48
+ # SupportedStylesAlignWith: keyword, variable, start_of_line
49
+ Layout/EndAlignment:
50
+ Exclude:
51
+ - 'db/migrate/20091029165620_add_parts_fields_to_products.rb'
52
+
53
+ # Offense count: 1
54
+ # This cop supports safe autocorrection (--autocorrect).
55
+ # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
56
+ Layout/ExtraSpacing:
57
+ Exclude:
58
+ - 'solidus_product_assembly.gemspec'
59
+
60
+ # Offense count: 1
61
+ # This cop supports safe autocorrection (--autocorrect).
62
+ # Configuration parameters: Width, AllowedPatterns, IgnoredPatterns.
63
+ Layout/IndentationWidth:
64
+ Exclude:
65
+ - 'spec/models/spree/shipment_spec.rb'
66
+
67
+ # Offense count: 8
68
+ # This cop supports safe autocorrection (--autocorrect).
69
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
70
+ # SupportedStyles: aligned, indented, indented_relative_to_receiver
71
+ Layout/MultilineMethodCallIndentation:
72
+ Exclude:
73
+ - 'app/decorators/models/solidus_product_assembly/spree/product_decorator.rb'
74
+ - 'spec/models/spree/order_contents_spec.rb'
75
+
76
+ # Offense count: 1
77
+ # This cop supports safe autocorrection (--autocorrect).
78
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
79
+ # SupportedStylesForExponentOperator: space, no_space
80
+ Layout/SpaceAroundOperators:
81
+ Exclude:
82
+ - 'solidus_product_assembly.gemspec'
83
+
84
+ # Offense count: 1
85
+ # This cop supports safe autocorrection (--autocorrect).
86
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
87
+ # SupportedStyles: space, no_space
88
+ # SupportedStylesForEmptyBraces: space, no_space
89
+ Layout/SpaceInsideBlockBraces:
90
+ Exclude:
91
+ - 'spec/models/spree/shipment_spec.rb'
92
+
93
+ # Offense count: 1
94
+ # This cop supports safe autocorrection (--autocorrect).
95
+ # Configuration parameters: AllowInHeredoc.
96
+ Layout/TrailingWhitespace:
97
+ Exclude:
98
+ - 'spec/features/checkout_spec.rb'
99
+
100
+ # Offense count: 1
101
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
102
+ Lint/AmbiguousBlockAssociation:
103
+ Exclude:
104
+ - 'spec/models/spree/order_inventory_spec.rb'
105
+
106
+ # Offense count: 1
107
+ # This cop supports safe autocorrection (--autocorrect).
108
+ Lint/AmbiguousOperator:
109
+ Exclude:
110
+ - 'app/views/spree/api/line_items/show.v1.rabl'
111
+
112
+ # Offense count: 1
113
+ Lint/MissingSuper:
114
+ Exclude:
115
+ - 'app/models/spree/order_inventory_assembly.rb'
116
+
117
+ # Offense count: 1
118
+ # This cop supports safe autocorrection (--autocorrect).
119
+ Lint/RedundantCopDisableDirective:
120
+ Exclude:
121
+ - 'lib/generators/solidus_product_assembly/install/install_generator.rb'
122
+
123
+ # Offense count: 3
124
+ Lint/ShadowingOuterLocalVariable:
125
+ Exclude:
126
+ - 'app/decorators/models/solidus_product_assembly/spree/shipment_decorator.rb'
127
+ - 'lib/tasks/spree2_upgrade.rake'
128
+
129
+ # Offense count: 2
130
+ # This cop supports safe autocorrection (--autocorrect).
131
+ Performance/BigDecimalWithNumericArgument:
132
+ Exclude:
133
+ - 'spec/models/spree/inventory_unit_spec.rb'
134
+
135
+ # Offense count: 3
136
+ # This cop supports unsafe autocorrection (--autocorrect-all).
137
+ Performance/TimesMap:
138
+ Exclude:
139
+ - 'app/decorators/models/solidus_product_assembly/spree/stock/inventory_unit_builder_decorator.rb'
140
+ - 'spec/models/spree/shipment_spec.rb'
141
+
142
+ # Offense count: 4
143
+ RSpec/AnyInstance:
144
+ Exclude:
145
+ - 'spec/features/admin/return_items_spec.rb'
146
+ - 'spec/models/spree/stock/availability_validator_spec.rb'
147
+
148
+ # Offense count: 2
149
+ # This cop supports safe autocorrection (--autocorrect).
150
+ RSpec/Capybara/CurrentPathExpectation:
151
+ Exclude:
152
+ - 'spec/features/checkout_spec.rb'
153
+
154
+ # Offense count: 42
155
+ # Configuration parameters: Prefixes, AllowedPatterns.
156
+ # Prefixes: when, with, without
157
+ RSpec/ContextWording:
158
+ Exclude:
159
+ - 'spec/features/admin/orders_spec.rb'
160
+ - 'spec/features/checkout_spec.rb'
161
+ - 'spec/models/spree/assemblies_part_spec.rb'
162
+ - 'spec/models/spree/inventory_unit_spec.rb'
163
+ - 'spec/models/spree/line_item_spec.rb'
164
+ - 'spec/models/spree/order_contents_spec.rb'
165
+ - 'spec/models/spree/order_inventory_assembly_spec.rb'
166
+ - 'spec/models/spree/order_inventory_spec.rb'
167
+ - 'spec/models/spree/shipment_spec.rb'
168
+ - 'spec/models/spree/stock/availability_validator_spec.rb'
169
+ - 'spec/models/spree/stock/coordinator_spec.rb'
170
+ - 'spec/models/spree/stock/inventory_unit_builder_spec.rb'
171
+ - 'spec/models/spree/variant_spec.rb'
172
+ - 'spec/support/shared_contexts/order_with_bundle.rb'
173
+
174
+ # Offense count: 2
175
+ # This cop supports safe autocorrection (--autocorrect).
176
+ RSpec/EmptyLineAfterFinalLet:
177
+ Exclude:
178
+ - 'spec/models/spree/shipment_spec.rb'
179
+
180
+ # Offense count: 9
181
+ RSpec/ExpectInHook:
182
+ Exclude:
183
+ - 'spec/features/checkout_spec.rb'
184
+ - 'spec/models/spree/line_item_spec.rb'
185
+
186
+ # Offense count: 14
187
+ # Configuration parameters: AssignmentOnly.
188
+ RSpec/InstanceVariable:
189
+ Exclude:
190
+ - 'spec/models/spree/product_spec.rb'
191
+
192
+ # Offense count: 14
193
+ RSpec/LetSetup:
194
+ Exclude:
195
+ - 'spec/features/checkout_spec.rb'
196
+ - 'spec/models/spree/order_contents_spec.rb'
197
+ - 'spec/models/spree/order_inventory_spec.rb'
198
+ - 'spec/models/spree/shipment_spec.rb'
199
+ - 'spec/models/spree/stock/availability_validator_spec.rb'
200
+ - 'spec/models/spree/stock/coordinator_spec.rb'
201
+
202
+ # Offense count: 9
203
+ # Configuration parameters: .
204
+ # SupportedStyles: have_received, receive
205
+ RSpec/MessageSpies:
206
+ EnforcedStyle: receive
207
+
208
+ # Offense count: 19
209
+ RSpec/MultipleExpectations:
210
+ Max: 14
211
+
212
+ # Offense count: 23
213
+ # Configuration parameters: AllowSubject.
214
+ RSpec/MultipleMemoizedHelpers:
215
+ Max: 10
216
+
217
+ # Offense count: 23
218
+ # Configuration parameters: IgnoreSharedExamples.
219
+ RSpec/NamedSubject:
220
+ Exclude:
221
+ - 'spec/models/spree/assemblies_part_spec.rb'
222
+ - 'spec/models/spree/inventory_unit_spec.rb'
223
+ - 'spec/models/spree/order_contents_spec.rb'
224
+ - 'spec/models/spree/order_inventory_assembly_spec.rb'
225
+ - 'spec/models/spree/order_inventory_spec.rb'
226
+ - 'spec/models/spree/product_spec.rb'
227
+ - 'spec/models/spree/stock/availability_validator_spec.rb'
228
+ - 'spec/models/spree/stock/coordinator_spec.rb'
229
+ - 'spec/models/spree/stock/inventory_unit_builder_spec.rb'
230
+
231
+ # Offense count: 2
232
+ # Configuration parameters: AllowedGroups.
233
+ RSpec/NestedGroups:
234
+ Max: 5
235
+
236
+ # Offense count: 3
237
+ # This cop supports safe autocorrection (--autocorrect).
238
+ RSpec/ScatteredLet:
239
+ Exclude:
240
+ - 'spec/models/spree/order_inventory_spec.rb'
241
+
242
+ # Offense count: 2
243
+ RSpec/StubbedMock:
244
+ Exclude:
245
+ - 'spec/models/spree/line_item_spec.rb'
246
+
247
+ # Offense count: 2
248
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
249
+ RSpec/VerifiedDoubles:
250
+ Exclude:
251
+ - 'spec/models/spree/line_item_spec.rb'
252
+ - 'spec/models/spree/stock/availability_validator_spec.rb'
253
+
254
+ # Offense count: 1
255
+ # Configuration parameters: Include.
256
+ # Include: db/migrate/*.rb
257
+ Rails/CreateTableWithTimestamps:
258
+ Exclude:
259
+ - 'db/migrate/20091028152124_add_many_to_many_relation_to_products.rb'
260
+
261
+ # Offense count: 2
262
+ # Configuration parameters: IgnoreScopes, Include.
263
+ # Include: app/models/**/*.rb
264
+ Rails/InverseOf:
265
+ Exclude:
266
+ - 'app/models/spree/assemblies_part.rb'
267
+
268
+ # Offense count: 2
269
+ # This cop supports safe autocorrection (--autocorrect).
270
+ Rails/RedundantForeignKey:
271
+ Exclude:
272
+ - 'app/models/spree/assemblies_part.rb'
273
+
274
+ # Offense count: 8
275
+ # Configuration parameters: ForbiddenMethods, AllowedMethods.
276
+ # ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
277
+ Rails/SkipsModelValidations:
278
+ Exclude:
279
+ - 'lib/tasks/spree2_upgrade.rake'
280
+ - 'spec/features/admin/return_items_spec.rb'
281
+ - 'spec/features/checkout_spec.rb'
282
+ - 'spec/models/spree/line_item_spec.rb'
283
+ - 'spec/models/spree/order_contents_spec.rb'
284
+ - 'spec/models/spree/order_inventory_spec.rb'
285
+ - 'spec/models/spree/shipment_spec.rb'
286
+ - 'spec/models/spree/stock/coordinator_spec.rb'
287
+
288
+ # Offense count: 2
289
+ # This cop supports unsafe autocorrection (--autocorrect-all).
290
+ # Configuration parameters: EnforcedStyle.
291
+ # SupportedStyles: nested, compact
292
+ Style/ClassAndModuleChildren:
293
+ Exclude:
294
+ - 'app/controllers/spree/admin/parts_controller.rb'
295
+ - 'app/models/spree/calculator/returns/assemblies_default_refund_amount.rb'
296
+
297
+ # Offense count: 3
298
+ # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
299
+ Style/GuardClause:
300
+ Exclude:
301
+ - 'app/decorators/models/solidus_product_assembly/spree/line_item_decorator.rb'
302
+ - 'app/decorators/models/solidus_product_assembly/spree/stock/inventory_validator_decorator.rb'
303
+ - 'app/models/spree/order_inventory_assembly.rb'
304
+
305
+ # Offense count: 2
306
+ # This cop supports safe autocorrection (--autocorrect).
307
+ Style/OrAssignment:
308
+ Exclude:
309
+ - 'app/models/spree/order_inventory_assembly.rb'
310
+
311
+ # Offense count: 6
312
+ # This cop supports safe autocorrection (--autocorrect).
313
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
314
+ # URISchemes: http, https
315
+ Layout/LineLength:
316
+ Max: 146
data/CHANGELOG.md ADDED
@@ -0,0 +1,116 @@
1
+ # Changelog
2
+
3
+ ## [v1.2.0](https://github.com/solidusio-contrib/solidus_product_assembly/tree/v1.2.0) (2022-11-02)
4
+
5
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_product_assembly/compare/v1.1.0...v1.2.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Fix before payment override [\#112](https://github.com/solidusio-contrib/solidus_product_assembly/pull/112) ([cpfergus1](https://github.com/cpfergus1))
10
+ - Update to use forked solidus\_frontend when needed [\#111](https://github.com/solidusio-contrib/solidus_product_assembly/pull/111) ([waiting-for-dev](https://github.com/waiting-for-dev))
11
+ - Search part globalize [\#109](https://github.com/solidusio-contrib/solidus_product_assembly/pull/109) ([AlistairNorman](https://github.com/AlistairNorman))
12
+
13
+ ## [v1.1.0](https://github.com/solidusio-contrib/solidus_product_assembly/tree/v1.1.0) (2021-10-19)
14
+
15
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_product_assembly/compare/v1.0.0...v1.1.0)
16
+
17
+ **Closed issues:**
18
+
19
+ - Dependabot couldn't find a Gemfile-local for this project [\#107](https://github.com/solidusio-contrib/solidus_product_assembly/issues/107)
20
+ - Prepare Solidus Product Assembly for Solidus 3.0 [\#102](https://github.com/solidusio-contrib/solidus_product_assembly/issues/102)
21
+ - Error on running specs locally [\#91](https://github.com/solidusio-contrib/solidus_product_assembly/issues/91)
22
+ - Dependabot can't resolve your Ruby dependency files [\#80](https://github.com/solidusio-contrib/solidus_product_assembly/issues/80)
23
+ - Dependabot can't resolve your Ruby dependency files [\#79](https://github.com/solidusio-contrib/solidus_product_assembly/issues/79)
24
+ - Dependabot can't resolve your Ruby dependency files [\#78](https://github.com/solidusio-contrib/solidus_product_assembly/issues/78)
25
+ - Dependabot can't resolve your Ruby dependency files [\#77](https://github.com/solidusio-contrib/solidus_product_assembly/issues/77)
26
+ - Dependabot can't resolve your Ruby dependency files [\#76](https://github.com/solidusio-contrib/solidus_product_assembly/issues/76)
27
+ - Dependabot can't resolve your Ruby dependency files [\#75](https://github.com/solidusio-contrib/solidus_product_assembly/issues/75)
28
+ - Dependabot can't resolve your Ruby dependency files [\#74](https://github.com/solidusio-contrib/solidus_product_assembly/issues/74)
29
+ - Dependabot can't resolve your Ruby dependency files [\#73](https://github.com/solidusio-contrib/solidus_product_assembly/issues/73)
30
+ - Action links for assembly don't work [\#62](https://github.com/solidusio-contrib/solidus_product_assembly/issues/62)
31
+ - Wrong return item amounts when returning orders with line items with quantity \> 1 [\#46](https://github.com/solidusio-contrib/solidus_product_assembly/issues/46)
32
+ - `method_missing': undefined method `add\_routes' [\#39](https://github.com/solidusio-contrib/solidus_product_assembly/issues/39)
33
+ - Deface is required [\#37](https://github.com/solidusio-contrib/solidus_product_assembly/issues/37)
34
+ - Javascript not registering Events [\#23](https://github.com/solidusio-contrib/solidus_product_assembly/issues/23)
35
+ - Cannot select parts [\#18](https://github.com/solidusio-contrib/solidus_product_assembly/issues/18)
36
+
37
+ **Merged pull requests:**
38
+
39
+ - Solidus 3 preparation [\#106](https://github.com/solidusio-contrib/solidus_product_assembly/pull/106) ([cpfergus1](https://github.com/cpfergus1))
40
+ - Upgrade to GitHub-native Dependabot [\#104](https://github.com/solidusio-contrib/solidus_product_assembly/pull/104) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
41
+ - Bump solidus\_support dependency to \(~\> 0.5\) [\#96](https://github.com/solidusio-contrib/solidus_product_assembly/pull/96) ([jcsanti](https://github.com/jcsanti))
42
+ - Display parts' available\_on in the admin's "parts" tab \(feature proposal\) [\#95](https://github.com/solidusio-contrib/solidus_product_assembly/pull/95) ([jcsanti](https://github.com/jcsanti))
43
+ - Fix Community Guidelines link in Readme [\#94](https://github.com/solidusio-contrib/solidus_product_assembly/pull/94) ([jcsanti](https://github.com/jcsanti))
44
+ - Fix failing test in shipment\_spec due to missing store [\#93](https://github.com/solidusio-contrib/solidus_product_assembly/pull/93) ([jcsanti](https://github.com/jcsanti))
45
+ - Fix deprecation warning about SolidusSupport.solidus\_gem\_version [\#84](https://github.com/solidusio-contrib/solidus_product_assembly/pull/84) ([stem](https://github.com/stem))
46
+ - Upgrade the extension using solidus\_dev\_support [\#81](https://github.com/solidusio-contrib/solidus_product_assembly/pull/81) ([blocknotes](https://github.com/blocknotes))
47
+ - Adopt solidus\_extension\_dev\_tools [\#71](https://github.com/solidusio-contrib/solidus_product_assembly/pull/71) ([aldesantis](https://github.com/aldesantis))
48
+ - Remove deprecation for Reimbursement\#simulate [\#69](https://github.com/solidusio-contrib/solidus_product_assembly/pull/69) ([spaghetticode](https://github.com/spaghetticode))
49
+ - Remove broken buttons in Shipments page [\#68](https://github.com/solidusio-contrib/solidus_product_assembly/pull/68) ([spaghetticode](https://github.com/spaghetticode))
50
+ - Update factory\_bot requirement from 5.1.0 to 5.1.1 [\#67](https://github.com/solidusio-contrib/solidus_product_assembly/pull/67) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
51
+ - Update puma requirement from ~\> 3.12 to ~\> 4.2 [\#66](https://github.com/solidusio-contrib/solidus_product_assembly/pull/66) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
52
+ - Update factory\_bot requirement from 4.10.0 to 5.1.0 [\#65](https://github.com/solidusio-contrib/solidus_product_assembly/pull/65) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
53
+ - Update pg requirement from ~\> 0.21 to ~\> 1.1 [\#64](https://github.com/solidusio-contrib/solidus_product_assembly/pull/64) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
54
+ - Update sqlite3 requirement from ~\> 1.3.6 to ~\> 1.4.1 [\#63](https://github.com/solidusio-contrib/solidus_product_assembly/pull/63) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
55
+ - Use `ActionView::Helpers::TranslationHelper.t` [\#60](https://github.com/solidusio-contrib/solidus_product_assembly/pull/60) ([spaghetticode](https://github.com/spaghetticode))
56
+ - Releasing new gem version to RubyGems, changelog generation [\#57](https://github.com/solidusio-contrib/solidus_product_assembly/pull/57) ([spaghetticode](https://github.com/spaghetticode))
57
+ - Remove Travis CI [\#56](https://github.com/solidusio-contrib/solidus_product_assembly/pull/56) ([spaghetticode](https://github.com/spaghetticode))
58
+ - Add SKU to \_stock\_item [\#55](https://github.com/solidusio-contrib/solidus_product_assembly/pull/55) ([ericsaupe](https://github.com/ericsaupe))
59
+ - Add CircleCI build [\#54](https://github.com/solidusio-contrib/solidus_product_assembly/pull/54) ([spaghetticode](https://github.com/spaghetticode))
60
+ - Load Capybara config from `solidus_support` gem [\#53](https://github.com/solidusio-contrib/solidus_product_assembly/pull/53) ([spaghetticode](https://github.com/spaghetticode))
61
+ - Fix build on Travis [\#52](https://github.com/solidusio-contrib/solidus_product_assembly/pull/52) ([spaghetticode](https://github.com/spaghetticode))
62
+ - Update `#determine_target_shipment` after Solidus \#3197 [\#50](https://github.com/solidusio-contrib/solidus_product_assembly/pull/50) ([spaghetticode](https://github.com/spaghetticode))
63
+ - Show split/delete actions for all items \(admin/orders/shipment\) [\#49](https://github.com/solidusio-contrib/solidus_product_assembly/pull/49) ([MinasMazar](https://github.com/MinasMazar))
64
+ - Show correct RMA amounts when assembly has more than one piece for var… [\#48](https://github.com/solidusio-contrib/solidus_product_assembly/pull/48) ([spaghetticode](https://github.com/spaghetticode))
65
+ - Fix build on Travis [\#47](https://github.com/solidusio-contrib/solidus_product_assembly/pull/47) ([spaghetticode](https://github.com/spaghetticode))
66
+ - Fix return item amounts with multiple items [\#45](https://github.com/solidusio-contrib/solidus_product_assembly/pull/45) ([spaghetticode](https://github.com/spaghetticode))
67
+ - add deface as a development dependency in gemspec [\#44](https://github.com/solidusio-contrib/solidus_product_assembly/pull/44) ([kevinjbayer](https://github.com/kevinjbayer))
68
+ - Round up default refund amount for assembly parts [\#43](https://github.com/solidusio-contrib/solidus_product_assembly/pull/43) ([spaghetticode](https://github.com/spaghetticode))
69
+ - Remove assembly part prices from carton manifest [\#42](https://github.com/solidusio-contrib/solidus_product_assembly/pull/42) ([spaghetticode](https://github.com/spaghetticode))
70
+ - Split refund amount proportionally on each assembly part [\#41](https://github.com/solidusio-contrib/solidus_product_assembly/pull/41) ([spaghetticode](https://github.com/spaghetticode))
71
+ - Fix stock finalization with non-backorderable stock and Solidus \>= 2.8 [\#40](https://github.com/solidusio-contrib/solidus_product_assembly/pull/40) ([spaghetticode](https://github.com/spaghetticode))
72
+ - Replace `Spree.t` with `I18n.t` [\#38](https://github.com/solidusio-contrib/solidus_product_assembly/pull/38) ([spaghetticode](https://github.com/spaghetticode))
73
+ - Lock SQLite3 to version 1.3 [\#36](https://github.com/solidusio-contrib/solidus_product_assembly/pull/36) ([aitbw](https://github.com/aitbw))
74
+ - Add Solidus v2.8 to Travis config [\#35](https://github.com/solidusio-contrib/solidus_product_assembly/pull/35) ([aitbw](https://github.com/aitbw))
75
+ - Remove stale edit button [\#34](https://github.com/solidusio-contrib/solidus_product_assembly/pull/34) ([spaghetticode](https://github.com/spaghetticode))
76
+ - Use Selenium with Chrome headless instead of Poltergeist [\#33](https://github.com/solidusio-contrib/solidus_product_assembly/pull/33) ([spaghetticode](https://github.com/spaghetticode))
77
+ - Fix `stock_item` partial for splitting items [\#32](https://github.com/solidusio-contrib/solidus_product_assembly/pull/32) ([spaghetticode](https://github.com/spaghetticode))
78
+ - Fix admin edit for shipping costs and tracking [\#31](https://github.com/solidusio-contrib/solidus_product_assembly/pull/31) ([spaghetticode](https://github.com/spaghetticode))
79
+ - AvailabilityValidator delegates to Solidus implementation when product is not an assembly [\#30](https://github.com/solidusio-contrib/solidus_product_assembly/pull/30) ([spaghetticode](https://github.com/spaghetticode))
80
+ - Test suite maintenance [\#29](https://github.com/solidusio-contrib/solidus_product_assembly/pull/29) ([aitbw](https://github.com/aitbw))
81
+ - Remove 2.2 from CI \(EOL\) [\#28](https://github.com/solidusio-contrib/solidus_product_assembly/pull/28) ([jacobherrington](https://github.com/jacobherrington))
82
+ - Remove versions past EOL from .travis.yml [\#27](https://github.com/solidusio-contrib/solidus_product_assembly/pull/27) ([jacobherrington](https://github.com/jacobherrington))
83
+ - Add Solidus 2.7 to .travis.yml [\#26](https://github.com/solidusio-contrib/solidus_product_assembly/pull/26) ([jacobherrington](https://github.com/jacobherrington))
84
+ - Update for Solidus 2.5 [\#21](https://github.com/solidusio-contrib/solidus_product_assembly/pull/21) ([jhawthorn](https://github.com/jhawthorn))
85
+ - Fix warnings [\#20](https://github.com/solidusio-contrib/solidus_product_assembly/pull/20) ([jhawthorn](https://github.com/jhawthorn))
86
+ - 2.4 fixes [\#19](https://github.com/solidusio-contrib/solidus_product_assembly/pull/19) ([jhawthorn](https://github.com/jhawthorn))
87
+ - Avoid stubbing in spec [\#17](https://github.com/solidusio-contrib/solidus_product_assembly/pull/17) ([jhawthorn](https://github.com/jhawthorn))
88
+ - Remove old Spree information from README [\#16](https://github.com/solidusio-contrib/solidus_product_assembly/pull/16) ([brchristian](https://github.com/brchristian))
89
+ - Removing small\_image Method Call. Replacing It To Avoid Error. [\#15](https://github.com/solidusio-contrib/solidus_product_assembly/pull/15) ([hugohernani](https://github.com/hugohernani))
90
+ - Fix deprecations and removals [\#14](https://github.com/solidusio-contrib/solidus_product_assembly/pull/14) ([jhawthorn](https://github.com/jhawthorn))
91
+ - Remove add\_routes fo routes.draw [\#13](https://github.com/solidusio-contrib/solidus_product_assembly/pull/13) ([denissellu](https://github.com/denissellu))
92
+ - Fix migration to allow rollback [\#12](https://github.com/solidusio-contrib/solidus_product_assembly/pull/12) ([tudorpavel](https://github.com/tudorpavel))
93
+ - Parts informations in API [\#11](https://github.com/solidusio-contrib/solidus_product_assembly/pull/11) ([DanielePalombo](https://github.com/DanielePalombo))
94
+
95
+ ## [v1.0.0](https://github.com/solidusio-contrib/solidus_product_assembly/tree/v1.0.0) (2016-09-06)
96
+
97
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_product_assembly/compare/7a6d85258735c0035d675364fc9000cdd7355e0e...v1.0.0)
98
+
99
+ **Closed issues:**
100
+
101
+ - Inventory Validation fail upon checkout, for the assembly product [\#3](https://github.com/solidusio-contrib/solidus_product_assembly/issues/3)
102
+
103
+ **Merged pull requests:**
104
+
105
+ - Add support for Solidus 2.0 and Rails 5 [\#10](https://github.com/solidusio-contrib/solidus_product_assembly/pull/10) ([jhawthorn](https://github.com/jhawthorn))
106
+ - Fix installation instructions in README [\#9](https://github.com/solidusio-contrib/solidus_product_assembly/pull/9) ([alexblackie](https://github.com/alexblackie))
107
+ - Add missing translation for actions.delete [\#8](https://github.com/solidusio-contrib/solidus_product_assembly/pull/8) ([Sinetheta](https://github.com/Sinetheta))
108
+ - Fix a load order issue when redefining inventory validator. [\#7](https://github.com/solidusio-contrib/solidus_product_assembly/pull/7) ([Senjai](https://github.com/Senjai))
109
+ - Fix product sub\_menu display on new Solidus [\#6](https://github.com/solidusio-contrib/solidus_product_assembly/pull/6) ([Sinetheta](https://github.com/Sinetheta))
110
+ - Inventory validation [\#5](https://github.com/solidusio-contrib/solidus_product_assembly/pull/5) ([Sinetheta](https://github.com/Sinetheta))
111
+ - Rename to solidus\_product\_assembly [\#2](https://github.com/solidusio-contrib/solidus_product_assembly/pull/2) ([Sinetheta](https://github.com/Sinetheta))
112
+ - Upgrade from spree 2.4 to solidus 1.1-1.3 [\#1](https://github.com/solidusio-contrib/solidus_product_assembly/pull/1) ([Sinetheta](https://github.com/Sinetheta))
113
+
114
+
115
+
116
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -1,18 +1,45 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
2
5
 
3
6
  branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
- gem "solidus", github: "solidusio/solidus", branch: branch
7
+ solidus_git, solidus_frontend_git = if (branch == 'master') || (branch >= 'v3.2')
8
+ %w[solidusio/solidus solidusio/solidus_frontend]
9
+ else
10
+ %w[solidusio/solidus] * 2
11
+ end
12
+ gem 'solidus', github: solidus_git, branch: branch
13
+ gem 'solidus_frontend', github: solidus_frontend_git, branch: branch
14
+
15
+ # Needed to help Bundler figure out how to resolve dependencies,
16
+ # otherwise it takes forever to resolve them.
17
+ # See https://github.com/bundler/bundler/issues/6677
18
+ gem 'rails', '>0.a'
19
+
20
+ # Provides basic authentication functionality for testing parts of your engine
5
21
  gem 'solidus_auth_devise'
22
+ gem 'solidus_globalize', github: 'solidusio-contrib/solidus_globalize'
6
23
 
7
- if branch == 'master' || branch >= "v2.0"
8
- gem "rails-controller-testing", group: :test
24
+ case ENV.fetch('DB', nil)
25
+ when 'mysql'
26
+ gem 'mysql2'
27
+ when 'postgresql'
28
+ gem 'pg'
29
+ else
30
+ gem 'sqlite3'
9
31
  end
10
32
 
11
- gem 'pg'
12
- gem 'mysql2'
13
-
14
- group :development, :test do
15
- gem "pry-rails"
33
+ group :test do
34
+ gem 'webdrivers'
35
+ gem 'selenium-webdriver'
16
36
  end
17
37
 
18
38
  gemspec
39
+
40
+ # Use a local Gemfile to include development dependencies that might not be
41
+ # relevant for the project or for other contributors, e.g. pry-byebug.
42
+ #
43
+ # We use `send` instead of calling `eval_gemfile` to work around an issue with
44
+ # how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
45
+ send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'