tramway-api 0.2.1 → 0.2.1.1

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: 14522e3ab145cb4db73589c0b400810f70e70e58be759b70cc5387796c13f723
4
- data.tar.gz: 7a4b1d04e37f54aab5723453b9c732667f5dc4c77b81816c76f50492affd420b
3
+ metadata.gz: 03fbedd30fa36978033c8708ebaeb33aa299d421d20579af7c79f5a93c7a45b2
4
+ data.tar.gz: 6ad47c29de3d35109b6a0be88ef265c1a8d805eb1044e8b4826b12ba3e178b5f
5
5
  SHA512:
6
- metadata.gz: 8fda0fdbe3a3f8f876f44ab55b154145cc048cec0dea58313318e8f66b644f86806b3f3a8ef3195d40a0b84756c1bf20ec0a31f90e93760cb1dcd97a88c370e0
7
- data.tar.gz: 4441b5071077fc65924a5949237a280c47edf4367c5fa7016aa0538092ca526c56dac6e790336358ca22551421ebbcb39621afa9226695dffad5baa644fe2e55
6
+ metadata.gz: 6e7353971838d17ec2c0bb1dddbaa12afe1d5273ced54e1c663ca7e9039a70829fb01d0e1a5e343bdcf673ce8d7911e4d57db04a5b36834304c3e3d1fe483166
7
+ data.tar.gz: 35bc486bf678c29fba6d53c5bf9053e5c7bb591ff2bfdb48309864eac44cd058577f66c936c5f30ec22c843fae8ff69332849bbb654814271bfe1cf7c41c45cd
@@ -1,8 +1,10 @@
1
+ require 'tramway/api/authenticate_helper'
2
+
1
3
  module Tramway
2
4
  module Api
3
5
  class ApplicationController < ::Tramway::Core::ApplicationController
4
6
  include Knock::Authenticable
5
- include AuthenticateHelper
7
+ include ::Tramway::Api::AuthenticateHelper
6
8
  protect_from_forgery with: :null_session, if: proc { |c| c.request.format == 'application/json' }
7
9
  rescue_from ActiveRecord::RecordNotFound, with: :not_found
8
10
 
@@ -6,7 +6,7 @@ class Tramway::Api::V1::UsersController < ::Tramway::Api::V1::ApplicationControl
6
6
 
7
7
  def create
8
8
  user_form = form_class_name(Tramway::Api.user_based_model).new Tramway::Api.user_based_model.new
9
- if user_form.validate params
9
+ if user_form.validate params[Tramway::Api.user_based_model.name.underscore]
10
10
  user_form.save
11
11
  token = ::Knock::AuthToken.new(payload: { sub: user_form.model.id }).token
12
12
  serialized_user = OpenStruct.new user_form.model.attributes.merge authentication_token: token
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Api
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-16 00:00:00.000000000 Z
11
+ date: 2019-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: knock