apicasso 0.2.4 → 0.2.5
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: b72c4ef79d2e810044739cccd545ca9173799cf5
|
4
|
+
data.tar.gz: 678b43fa8722fa34055bebc58fe892dd9358e0eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14d477ffb6b09261f3b6079ce10b2085f534efb40aea966369a5fb5c981c222b3d9ea755eedd5fd0c7307b159f708b8b09a5653f327ec73e78c018ba91f86a1
|
7
|
+
data.tar.gz: dfb4badb1c07ff00614c4dfd400faf6ebe860205e40de9d79673646a181e0f823c91bd01510e6a56c884862d63c650d5d5cb954f453f5105067029c08dd280ed
|
@@ -6,6 +6,7 @@ module Apicasso
|
|
6
6
|
class ApplicationController < ActionController::API
|
7
7
|
include ActionController::HttpAuthentication::Token::ControllerMethods
|
8
8
|
prepend_before_action :restrict_access, unless: -> { preflight? }
|
9
|
+
before_action :set_access_control_headers
|
9
10
|
after_action :register_api_request
|
10
11
|
|
11
12
|
# Sets the authorization scope for the current API key
|
@@ -19,11 +19,13 @@ module Apicasso
|
|
19
19
|
# the page 42 of that collection. Usage:
|
20
20
|
# GET /sites?sort=+name,-updated_at&q[domain_eq]=domain.com&page=42&per_page=42
|
21
21
|
def index
|
22
|
+
set_access_control_headers
|
22
23
|
render json: index_json
|
23
24
|
end
|
24
25
|
|
25
26
|
# GET /:resource/1
|
26
27
|
def show
|
28
|
+
set_access_control_headers
|
27
29
|
render json: @object.to_json(include: parsed_include)
|
28
30
|
end
|
29
31
|
|
@@ -72,12 +74,8 @@ module Apicasso
|
|
72
74
|
# Will return a JSON with the schema of the current resource, using
|
73
75
|
# attribute names as keys and attirbute types as values.
|
74
76
|
def schema
|
75
|
-
|
76
|
-
|
77
|
-
head :no_content
|
78
|
-
else
|
79
|
-
render json: resource_schema.to_json
|
80
|
-
end
|
77
|
+
byebug
|
78
|
+
render json: resource_schema.to_json unless preflight?
|
81
79
|
end
|
82
80
|
|
83
81
|
private
|
data/lib/apicasso/version.rb
CHANGED