spree_api 2.4.5 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1355738b99bc466e3299757f7f4d293a08ad45c
|
4
|
+
data.tar.gz: 9a81176332680c7c6802b11c395cd6c944a335c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576d4ca00833617cf383fa6c2c9ef25f5d0f82a1f3c20cbf53e2270c980dbb23aa390fa38b2945acb1aa109e9da1a1599b847fd5a39e417a746f4f8a2869276d
|
7
|
+
data.tar.gz: ede324c67a8f201a77f43a12b5321fae1a8a8bd72342564ef9e3cd37313c2f74bff53b6a1be2c437c50bc2c86f1d4942ed6334224bddd02054f9b1f2efccb2e9
|
@@ -18,8 +18,6 @@ module Spree
|
|
18
18
|
before_action :authenticate_user
|
19
19
|
before_action :load_user_roles
|
20
20
|
|
21
|
-
after_filter :set_jsonp_format
|
22
|
-
|
23
21
|
rescue_from Exception, with: :error_during_processing
|
24
22
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
25
23
|
rescue_from CanCan::AccessDenied, with: :unauthorized
|
@@ -29,13 +27,6 @@ module Spree
|
|
29
27
|
|
30
28
|
ssl_allowed
|
31
29
|
|
32
|
-
def set_jsonp_format
|
33
|
-
if params[:callback] && request.get?
|
34
|
-
self.response_body = "#{params[:callback]}(#{response.body})"
|
35
|
-
headers["Content-Type"] = 'application/javascript'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
30
|
def map_nested_attributes_keys(klass, attributes)
|
40
31
|
nested_keys = klass.nested_attributes_options.keys
|
41
32
|
attributes.inject({}) do |h, (k,v)|
|
@@ -4,6 +4,7 @@ attributes *variant_attributes
|
|
4
4
|
|
5
5
|
node(:display_price) { |p| p.display_price.to_s }
|
6
6
|
node(:options_text) { |v| v.options_text }
|
7
|
+
node(:track_inventory) { |v| v.should_track_inventory? }
|
7
8
|
node(:in_stock) { |v| v.in_stock? }
|
8
9
|
node(:is_backorderable) { |v| v.is_backorderable? }
|
9
10
|
node(:total_on_hand) { |v| v.total_on_hand }
|
@@ -145,21 +145,6 @@ module Spree
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
-
context "jsonp" do
|
149
|
-
it "retrieves a list of products of jsonp" do
|
150
|
-
api_get :index, {:callback => 'callback'}
|
151
|
-
expect(response.body).to match(/^callback\(.*\)$/)
|
152
|
-
expect(response.header['Content-Type']).to include('application/javascript')
|
153
|
-
end
|
154
|
-
|
155
|
-
# Regression test for #4332
|
156
|
-
it "does not escape quotes" do
|
157
|
-
api_get :index, {:callback => 'callback'}
|
158
|
-
expect(response.body).to match(/^callback\({"count":1,"total_count":1/)
|
159
|
-
expect(response.header['Content-Type']).to include('application/javascript')
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
148
|
it "can search for products" do
|
164
149
|
create(:product, :name => "The best product in the world")
|
165
150
|
api_get :index, :q => { :name_cont => "best" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.4.
|
19
|
+
version: 2.4.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.4.
|
26
|
+
version: 2.4.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rabl
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|