usman 0.3.12 → 0.3.13

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: 7a33d03ab591b1d81c7932381a529fc6b8e49596
4
- data.tar.gz: 7e05516ca568ba08a3796ece8a2be8eb4b45fbc7
3
+ metadata.gz: 01ac583f7b2db6539f7c30c806d1c706c63d0c90
4
+ data.tar.gz: 3fe75fd1f24555c3e8560f7e9568e22faf57e0d9
5
5
  SHA512:
6
- metadata.gz: e310e90539e2b9a9e01279c6fff55c7435ea48e0633b41f2ff26d1e7a99c832422230ae227cef3d010f66babaddd39ba7ee18bebed2a040c3bfbe2150bb2bf1d
7
- data.tar.gz: 505f308e8dcab1cde114683b6dc7a6b0af10264533eec8f98d85d77089762ea6295891a189b676fa4b2aff05e1643102a3c6d20401d8221c9c27ec16f003ff4a
6
+ metadata.gz: aee20527bc3c9bd207f5f8e6a8c7bc449bfc0847bc82da46f5ab96fbc33922323c5128c57a444d6a51c7e18fafe67ce832cc5f836174848283ff46e588768373
7
+ data.tar.gz: 5a79998e67e318b8e7dbfe42358342d80a8cfde4800091a78d6eb4b5ef8554093fdfdd7f3611e3235c1c2d516490e11d3b87f9050278b385ee88019002c1c817
@@ -100,6 +100,7 @@ module Usman
100
100
  @user = @current_user
101
101
  @user.name = permitted_params[:name]
102
102
  @user.gender = permitted_params[:gender]
103
+ @user.dummy = false
103
104
  @user.date_of_birth = permitted_params[:date_of_birth]
104
105
  @user.email = permitted_params[:email]
105
106
 
@@ -106,25 +106,8 @@ module Usman
106
106
  else
107
107
  @data = { api_token: "" }
108
108
  end
109
- @data[:registration] = @registration
110
- user = @registration.user
111
- if user
112
- @data[:profile] = {
113
- id: user.id,
114
- name: user.name,
115
- gender: user.gender,
116
- email: user.email,
117
- date_of_birth: user.date_of_birth
118
- }
119
- else
120
- @data[:profile] = {
121
- id: "",
122
- name: "",
123
- gender: "",
124
- email: "",
125
- date_of_birth: ""
126
- }
127
- end
109
+ @data[:registration] = ActiveModelSerializers::SerializableResource.new(@registration, serializer: RegistrationSerializer)
110
+ @data[:profile] = ActiveModelSerializers::SerializableResource.new(@registration.user, serializer: ProfileSerializer)
128
111
  else
129
112
  @success = false
130
113
  @errors = {
@@ -186,7 +169,11 @@ module Usman
186
169
  heading: I18n.translate("api.accept_tac.tac_accepted.heading"),
187
170
  message: I18n.translate("api.accept_tac.tac_accepted.message")
188
171
  }
189
- @data = { api_token: @device.api_token } if @device.verified? && @device.tac_accepted?
172
+ if @device.verified? && @device.tac_accepted?
173
+ @data = { api_token: @device.api_token }
174
+ @data[:registration] = ActiveModelSerializers::SerializableResource.new(@registration, serializer: RegistrationSerializer)
175
+ @data[:profile] = ActiveModelSerializers::SerializableResource.new(@registration.user, serializer: ProfileSerializer)
176
+ end
190
177
  else
191
178
  @success = false
192
179
  @errors = {
@@ -1,7 +1,7 @@
1
1
  class RegistrationSerializer < ActiveModel::Serializer
2
2
  include NullAttributeReplacer
3
3
 
4
- attributes :id, :dialing_prefix, :mobile_number, :status
4
+ attributes :id, :dialing_prefix, :mobile_number, :status, :user_id, :country_id, :city_id
5
5
 
6
6
  has_one :user, class_name: "User", serializer: ProfileSerializer do
7
7
  if object.user
@@ -19,7 +19,7 @@ api_output = <<-eos
19
19
  "success": true,
20
20
  "alert": {
21
21
  "heading": "OTP was verified succesfully",
22
- "message": "You may need to accept the terms and conditions to get the API token if you have not yet finised the registration"
22
+ "message": "You may need to accept the terms and conditions to get the API token if you have not yet finished the registration"
23
23
  },
24
24
  "data": {
25
25
  "api_token": "",
@@ -19,7 +19,7 @@ api_output = <<-eos
19
19
  "success": true,
20
20
  "alert": {
21
21
  "heading": "OTP was verified succesfully",
22
- "message": "You may need to accept the terms and conditions to get the API token if you have not yet finised the registration"
22
+ "message": "You may need to accept the terms and conditions to get the API token if you have not yet finished the registration"
23
23
  },
24
24
  "data": {
25
25
  "api_token": "22431f28189e2c88ba58ee221f373931",
@@ -57,7 +57,7 @@ en:
57
57
  message: "Check if you have properly given the OTP along with dialing prefix, mobile number & UUID"
58
58
  verification_success:
59
59
  heading: "OTP was verified succesfully"
60
- message: "You may need to accept the terms and conditions to get the API token if you have not yet finised the registration"
60
+ message: "You may need to accept the terms and conditions to get the API token if you have not yet finished the registration"
61
61
  accept_tac:
62
62
  tac_accepted:
63
63
  heading: "You have successfully accepted the Terms & Conditions. Proceed with Registration process if any"
@@ -57,7 +57,7 @@ en:
57
57
  message: "Check if you have properly given the OTP along with dialing prefix, mobile number & UUID"
58
58
  verification_success:
59
59
  heading: "OTP was verified succesfully"
60
- message: "You may need to accept the terms and conditions to get the API token if you have not yet finised the registration"
60
+ message: "You may need to accept the terms and conditions to get the API token if you have not yet finished the registration"
61
61
  accept_tac:
62
62
  tac_accepted:
63
63
  heading: "You have successfully accepted the Terms & Conditions. Proceed with Registration process if any"
data/lib/usman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Usman
2
- VERSION = '0.3.12'
2
+ VERSION = '0.3.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-02 00:00:00.000000000 Z
11
+ date: 2017-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -107,7 +107,7 @@ dependencies:
107
107
  version: '0.1'
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.1.18
110
+ version: 0.1.20
111
111
  type: :runtime
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,7 +117,7 @@ dependencies:
117
117
  version: '0.1'
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 0.1.18
120
+ version: 0.1.20
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: pattana
123
123
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +127,7 @@ dependencies:
127
127
  version: '0.1'
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: 0.1.15
130
+ version: 0.1.16
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ dependencies:
137
137
  version: '0.1'
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: 0.1.15
140
+ version: 0.1.16
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: bcrypt
143
143
  requirement: !ruby/object:Gem::Requirement