solidus_api 4.1.5 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed3e4eadc3cd2335bafecdb36c777963ee23cb41aed12f2e484a98c55d3fb0b3
4
- data.tar.gz: 81fc6fa82b06665a518b8670a7912c7072627929d003ddf83022f2993be76345
3
+ metadata.gz: f7e2701a445d769d1a6e77fbe41795f9a2cb9359be15b32de5218a9d020a2051
4
+ data.tar.gz: '038ea3bc825f44d389de90c977f161c2c313908f536b1933bd27f4d92a0975e1'
5
5
  SHA512:
6
- metadata.gz: d71047a3495bd98db5436e7a29df021fa11f0043c9a1f77dd7467790a94ba221e0be6f6fa1a303ee4e1b78572e8ad3eacba4ac2fb763f708612777711e1659ca
7
- data.tar.gz: '093cb59809e1e523cbb692000af3023cc64c236df7535165e7e94d96aa771e9a16737eb7e32dff229b17c918f76dee08d149caec651cb33d36edec1485a4b54d'
6
+ metadata.gz: 64897f53112d5eb9bd4253a79b8c2fd6fa89e38e768c2135b7503966c83c4adfc1eee035348913f626127fa24328921ac86641654bedeea2736604a7230e38fa
7
+ data.tar.gz: a6c64ee9ff17a62a7cec75b16bcf780db417abe9046b9811e49281d10580e6204d7a897af595bf198369a775056df70d9d866aba6fc8e41774bc87c5f1a4770c
data/Rakefile CHANGED
@@ -5,7 +5,6 @@ require 'rake'
5
5
  require 'rake/testtask'
6
6
  require 'rspec/core/rake_task'
7
7
  require 'spree/testing_support/dummy_app/rake_tasks'
8
- require 'bundler/gem_tasks'
9
8
 
10
9
  RSpec::Core::RakeTask.new
11
10
  task default: :spec
@@ -11,16 +11,15 @@ module Spree
11
11
 
12
12
  def create
13
13
  variant = Spree::Variant.find(params[:line_item][:variant_id])
14
- @line_item = @order.contents.add(
15
- variant,
16
- params[:line_item][:quantity] || 1,
17
- options: line_item_params[:options].to_h
18
- )
19
-
20
- if @line_item.errors.empty?
14
+ begin
15
+ @line_item = @order.contents.add(
16
+ variant,
17
+ params[:line_item][:quantity] || 1,
18
+ options: line_item_params[:options].to_h
19
+ )
21
20
  respond_with(@line_item, status: 201, default_template: :show)
22
- else
23
- invalid_resource!(@line_item)
21
+ rescue ActiveRecord::RecordInvalid => error
22
+ invalid_resource!(error.record)
24
23
  end
25
24
  end
26
25
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  json.(image, *image_attributes)
4
4
  json.(image, :viewable_type, :viewable_id)
5
- Spree::Image.attachment_definitions[:attachment][:styles].each_key do |key|
5
+ Spree::Image.attachment_definitions[:attachment][:styles].each do |key, _value|
6
6
  json.set! "#{key}_url", image.url(key)
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.5
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-05 00:00:00.000000000 Z
11
+ date: 2023-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jbuilder
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 4.1.5
61
+ version: 4.2.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 4.1.5
68
+ version: 4.2.0
69
69
  description: REST API for the Solidus e-commerce framework.
70
70
  email: contact@solidus.io
71
71
  executables: []
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  - !ruby/object:Gem::Version
274
274
  version: 1.8.23
275
275
  requirements: []
276
- rubygems_version: 3.4.19
276
+ rubygems_version: 3.3.23
277
277
  signing_key:
278
278
  specification_version: 4
279
279
  summary: REST API for the Solidus e-commerce framework.