tramway-api 1.0.2.2 → 1.0.3

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: 408807959271db1306b9048f9aaf1d210ae2f8e1b4d1c364789bb706112aa5a9
4
- data.tar.gz: 3b169249d7fd04aefbb3fb7d777f2a8f6f5a163046978e780001f009fb2df77f
3
+ metadata.gz: 6ca6fc2c599d996783de1ac8a07383ca7ceec44451ab39d51f30ef1431a5ca61
4
+ data.tar.gz: 15c2670773edde1c527b422817e354d333de13b8da3664f1c05345c8d32d9926
5
5
  SHA512:
6
- metadata.gz: 7e42a01f15193f7a3617f3c4af061fc7959cdc319ab4e0cc81f97ef5fd6322c13a31eb4ccc8ffc3f53936fd41cc56360ce1d67ef19ecb0b9b02b2c567e85a638
7
- data.tar.gz: 1b14778d781bb1f0343f7984c426e382066e7e9add7af4d833632259ce96c1fcade765e97a6f4cd9acf147a368a12d9c85cef6f75b7a8cd7dc9c335e4b40a1b8
6
+ metadata.gz: d9545ecbf121766e12b0ae76f1c527f9ce2d40288c033e6174e78e9c515551d7b0c5d314ebeb853568002a90abf9e82ec05c20418d7710acff826f86c5f477d3
7
+ data.tar.gz: a5ebb28926fc86784e31d6b581b2b15974dff66c5fb8cf7f9bb3ca066b63ee6673d1e347444d82fafbb63a83718aa5de230d60b8a04d88c7ad1cd9287ad90f5b
@@ -5,7 +5,7 @@ class Tramway::Api::V1::UsersController < ::Tramway::Api::V1::ApplicationControl
5
5
  include Tramway::ClassNameHelpers
6
6
 
7
7
  def create
8
- user_form = form_class_name(Tramway::Api.user_based_model).new Tramway::Api.user_based_model.new
8
+ user_form = sign_up_form_class_name(Tramway::Api.user_based_model).new Tramway::Api.user_based_model.new
9
9
  if user_form.submit params[Tramway::Api.user_based_model.name.underscore]
10
10
  token = ::Knock::AuthToken.new(payload: { sub: user_form.model.id }).token
11
11
  # FIXME refactor this bullshit
@@ -24,4 +24,10 @@ class Tramway::Api::V1::UsersController < ::Tramway::Api::V1::ApplicationControl
24
24
  def show
25
25
  render json: current_user, status: :ok
26
26
  end
27
+
28
+ private
29
+
30
+ def sign_up_form_class_name(model_class)
31
+ form_class_name "#{model_class}SignUp"
32
+ end
27
33
  end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Api
3
- VERSION = '1.0.2.2'
3
+ VERSION = '1.0.3'
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: 1.0.2.2
4
+ version: 1.0.3
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-06-02 00:00:00.000000000 Z
11
+ date: 2019-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: knock