solidus_api 2.11.0 → 2.11.5

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: 0073a2dd8fda3f900d1eacc4221b4ef2e0b418adb5a08818dfadd32aa8c55020
4
- data.tar.gz: 1f453e33e88e7f80a4c0b618cb4336a54cf8dff3044d9b526e6bb6d312f46e07
3
+ metadata.gz: b700b541040c01e87ec18bc5d65f51be73904fc72eed6cb11702f3d59e29857f
4
+ data.tar.gz: 1e218892060c961813eff6df57d8183f51704fdfd98670c6adef7805e546a42d
5
5
  SHA512:
6
- metadata.gz: 4783fe7f6037f082e38fd384732c895e7c591781d0770a45f107248b7380a40a6675cd1935455aaeef230ed7c0c4eb61e55f506eaaabbdb3a846de1a71989b0a
7
- data.tar.gz: e722663fa5ac036dc85edd355d8faa09a73b36c4dd3a3e17fa145a7f31f815349d71315355def89cfd724d5610497ce0bef6824d73cf1d554abe8f1b36e1659e
6
+ metadata.gz: 34dfc56c007035a10026061a90ddc88eb561829291bc4f1c195a40a65e494d70723b3c98d674ccdbca71faceaf9d88f376a45413814f7d8351b929834e4da883
7
+ data.tar.gz: 316013b0da91d2393f9528bbcb77125eda9de788238f7efc6f94f072adcf7aa721711d983fb86f7b2d35931cb510d895e790a523e67fe7ea659a03cb20f78c04
@@ -76,9 +76,11 @@ module Spree
76
76
  end
77
77
 
78
78
  def parameter_missing_error(exception)
79
+ # use original_message to remove DidYouMean suggestions, if defined
80
+ message = exception.try(:original_message) || exception.message
79
81
  render json: {
80
- exception: exception.message,
81
- error: exception.message,
82
+ exception: message,
83
+ error: message,
82
84
  missing_param: exception.param
83
85
  }, status: :unprocessable_entity
84
86
  end
@@ -20,7 +20,7 @@ module Spree
20
20
  end
21
21
 
22
22
  def update
23
- @image = scope.images.accessible_by(current_ability, :update).find(params[:id])
23
+ @image = scope.gallery.images.accessible_by(current_ability, :update).find(params[:id])
24
24
  @image.update(image_params)
25
25
  respond_with(@image, default_template: :show)
26
26
  end
@@ -53,7 +53,13 @@ class Spree::Api::ResourceController < Spree::Api::BaseController
53
53
  def destroy
54
54
  authorize! :destroy, @object
55
55
 
56
- if @object.destroy
56
+ destroy_result = if @object.respond_to?(:discard)
57
+ @object.discard
58
+ else
59
+ @object.destroy
60
+ end
61
+
62
+ if destroy_result
57
63
  respond_with(@object, status: 204)
58
64
  else
59
65
  invalid_resource!(@object)
@@ -30,11 +30,20 @@ module Spree
30
30
  # This method can be overriden (with a let block) inside a context
31
31
  # For instance, if you wanted to have an admin user instead.
32
32
  def current_api_user
33
- @current_api_user ||= stub_model(Spree::LegacyUser, email: "spree@example.com", spree_roles: [])
33
+ @current_api_user ||= stub_model(Spree::LegacyUser, email: "solidus@example.com", spree_roles: [])
34
34
  end
35
35
 
36
36
  def image(filename)
37
- File.open(Spree::Api::Engine.root + "spec/fixtures" + filename)
37
+ File.open(
38
+ File.join(
39
+ Spree::Core::Engine.root,
40
+ "lib",
41
+ "spree",
42
+ "testing_support",
43
+ "fixtures",
44
+ filename
45
+ )
46
+ )
38
47
  end
39
48
 
40
49
  def upload_image(filename)
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: 2.11.0
4
+ version: 2.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2021-03-10 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: 2.11.0
61
+ version: 2.11.5
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: 2.11.0
68
+ version: 2.11.5
69
69
  description: REST API for the Solidus e-commerce framework.
70
70
  email: contact@solidus.io
71
71
  executables: []
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  - !ruby/object:Gem::Version
273
273
  version: 1.8.23
274
274
  requirements: []
275
- rubygems_version: 3.0.3
275
+ rubygems_version: 3.1.4
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: REST API for the Solidus e-commerce framework.