usman 0.3.18 → 0.3.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/usman/api/v1/profile_controller.rb +4 -4
- data/app/models/user.rb +2 -0
- data/app/serializers/profile_serializer.rb +1 -1
- data/app/views/usman/users/_show.html.erb +6 -1
- data/db/migrate/20170929083236_add_country_city_to_users.rb +14 -0
- data/lib/usman/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c48cc7bd8d51aa2b31f2bac8cb4469bde5874ed
|
4
|
+
data.tar.gz: eaf3b0f77a1a4372aebbf3335d9ee1109ff42e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff9b9ebdaf521b43a9c3da93ff6788c81d561dd8e205e38f99ca1366b979c833c7a58d3ac469069e74f22ac11d7dcb5bade6bcf8c7a8254cde45b91070f033bd
|
7
|
+
data.tar.gz: 462bde7386a76c363f42a524af88e796e4246f9b6ea81d21730db14534cb5cad7c62afebdc77f67f4529ec2425a54bf00e278046d78a6853453a8027765f6437
|
@@ -30,8 +30,8 @@ module Usman
|
|
30
30
|
@user.approve!
|
31
31
|
@current_registration.user = @user
|
32
32
|
|
33
|
-
@
|
34
|
-
@
|
33
|
+
@user.country = @country if @country
|
34
|
+
@user.city = @city if @city
|
35
35
|
|
36
36
|
@current_registration.save
|
37
37
|
|
@@ -111,8 +111,8 @@ module Usman
|
|
111
111
|
@user.dummy = false
|
112
112
|
@user.save
|
113
113
|
|
114
|
-
@
|
115
|
-
@
|
114
|
+
@user.country = @country if @country
|
115
|
+
@user.city = @city if @city
|
116
116
|
|
117
117
|
@current_registration.save
|
118
118
|
|
data/app/models/user.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class ProfileSerializer < ActiveModel::Serializer
|
2
2
|
include NullAttributeReplacer
|
3
|
-
attributes :id, :name, :gender, :date_of_birth, :username, :email, :phone, :dummy
|
3
|
+
attributes :id, :name, :gender, :date_of_birth, :username, :email, :phone, :dummy, :country_id, :city_id
|
4
4
|
|
5
5
|
has_one :profile_picture, class_name: "Image::ProfilePicture", serializer: ProfilePictureSerializer do
|
6
6
|
if object.profile_picture
|
@@ -120,7 +120,7 @@
|
|
120
120
|
|
121
121
|
<tr>
|
122
122
|
<th>Name</th><td><%= @user.name %></td>
|
123
|
-
<th>Username</th><td><%= @user.username %></td>
|
123
|
+
<th>Username</th><td><%= @user.username %></td>
|
124
124
|
</tr>
|
125
125
|
|
126
126
|
<tr>
|
@@ -128,6 +128,11 @@
|
|
128
128
|
<th>Phone</th><td><%= @user.phone %></td>
|
129
129
|
</tr>
|
130
130
|
|
131
|
+
<tr>
|
132
|
+
<th>City</th><td><%= @user.city.try(:display_name) %></td>
|
133
|
+
<th>Country</th><td><%= @user.country.try(:display_name) %></td>
|
134
|
+
</tr>
|
135
|
+
|
131
136
|
<tr>
|
132
137
|
<th>Gender</th><td><%= @user.gender %></td>
|
133
138
|
<th>Date of Birth</th><td><%= @user.date_of_birth.strftime("%m/%d/%Y") if @user.date_of_birth %></td>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class AddCountryCityToUsers < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
add_column :users, :country_id, :integer
|
4
|
+
add_column :users, :city_id, :integer
|
5
|
+
Registration.in_batches.each do |relation|
|
6
|
+
relation.all.each do |reg|
|
7
|
+
user = reg.user
|
8
|
+
user.country_id = reg.country_id
|
9
|
+
user.city_id = reg.city_id
|
10
|
+
user.save
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/usman/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.19
|
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-
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -576,6 +576,7 @@ files:
|
|
576
576
|
- db/migrate/20170929083233_add_dummy_to_users.rb
|
577
577
|
- db/migrate/20170929083234_add_categorisable_to_features.rb
|
578
578
|
- db/migrate/20170929083235_change_disabled_to_removed_features.rb
|
579
|
+
- db/migrate/20170929083236_add_country_city_to_users.rb
|
579
580
|
- lib/tasks/usman/data.rake
|
580
581
|
- lib/tasks/usman/master_data.rake
|
581
582
|
- lib/temp/features.rake
|