thecore_api 1.3.4 → 1.3.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
  SHA256:
3
- metadata.gz: ec5fdf7f28b437794d2ee65d4e49bad4ae98420d22363394a8fc0aa504fb7325
4
- data.tar.gz: 546b1e9efdb394a82744f92c5dfd7ba6845277d4f8716654bec338b7050a361f
3
+ metadata.gz: 7ba25e97ca0df6dac1d4a056f6a493d22b291f66cdb83d2f92d87b96eb1e7727
4
+ data.tar.gz: 8a01c57ddcf3b1f161674245a04929ce8b7d7f091628c25ea731fff65c0d9924
5
5
  SHA512:
6
- metadata.gz: 0c17271220fe9bb6ea54abbc1f13a30a0d0a7793940f4641794b228ca4a236ec04cfb8b4d234f6244c6623cbcbfd71ca18c04ccce7e1994a78d64b4fed630fa9
7
- data.tar.gz: dc30b79e066c6264fd56f5fd5d8be5a632ef59079b375494ed3df9091736b99f0b4e39e95edd76631f121cce94224384c6208e14076aa79e21b18d303ed40098
6
+ metadata.gz: 1790ff7432f0e4979b28dd478fc990c947b522575110fb1aed7f36e99a079f8f4305a8393a38797c7cb70f50d2f52eb7fde76c8bb8e173f6f9eb1b969b3cb724
7
+ data.tar.gz: f2ea763ecbc44a9f840f0f24ac59a86703ab976fc9cd0da6b178dea7c1f997f74d8a2d536ac7598a686f57556b72681e2f415ac795653bb153892dc52ce19c3f
@@ -22,7 +22,7 @@ class Api::V1::BaseController < ActionController::API
22
22
  before_action :destroy_session
23
23
 
24
24
  before_action :authenticate_user!
25
- before_action :find_model, except: [ :version, :token, :available_roles, :check ]
25
+ before_action :find_model, except: [ :version, :token, :available_roles, :check, :translations ]
26
26
  before_action :find_record, only: [ :show, :update, :destroy ]
27
27
 
28
28
  rescue_from ActiveRecord::RecordNotFound, with: :not_found!
@@ -1,5 +1,6 @@
1
1
  class Api::V1::InfoController < Api::V1::BaseController
2
- skip_before_action :authenticate_user!, only: [:version]
2
+ # Info uses a different auth method: username and password
3
+ skip_before_action :authenticate_user!, only: [:version, :translations], raise: false
3
4
 
4
5
  # api :GET, '/api/v1/info/version', "Just prints the APPVERSION."
5
6
  # api!
@@ -25,11 +26,12 @@ class Api::V1::InfoController < Api::V1::BaseController
25
26
  render json: ROLES.to_json, status: 200
26
27
  end
27
28
 
29
+ # GET '/api/v1/info/translations'
28
30
  def translations
29
- render json: MultiJSON.dump(I18n.t(".", locale: (params[:locale].presence || :it)))
31
+ render json: I18n.t(".", locale: (params[:locale].presence || :it)).to_json, status: 200
30
32
  end
31
33
 
32
- private
34
+ # private
33
35
 
34
36
  # Method overridden because the first time I have to ask for the token
35
37
  def authenticate_user!
@@ -1,3 +1,3 @@
1
1
  module ThecoreApi
2
- VERSION = "1.3.4".freeze
2
+ VERSION = "1.3.5".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-14 00:00:00.000000000 Z
11
+ date: 2019-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore