apicasso 0.2.4 → 0.2.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
  SHA1:
3
- metadata.gz: a7907663e8e67e9617bfe8039b29d5f2786f2398
4
- data.tar.gz: 411eb68c03c52857f3359782a5f11399fabe8833
3
+ metadata.gz: b72c4ef79d2e810044739cccd545ca9173799cf5
4
+ data.tar.gz: 678b43fa8722fa34055bebc58fe892dd9358e0eb
5
5
  SHA512:
6
- metadata.gz: b58e5690a812b07392e4713ec0a6f6bb3ee0c98e19b24c41233e77aae13023249d73b9afd55b495a6d43401288037f9024f5e8fb07cd288b5ee4f13b17c78557
7
- data.tar.gz: 84fbe4b2ff9af56ca9ed8f2d6d8df7236bb519b46e3c3609d8b6d54a2af986c8ad807e17ecd678795cb236d07b9ff8e2f5784562d53a836b24e07dbb60cdbb13
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
- if preflight?
76
- set_access_control_headers
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
@@ -1,3 +1,3 @@
1
1
  module Apicasso
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apicasso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Bellincanta