minimum-omniauth-scaffold 0.1.5 → 0.1.6
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b58db84863bddeda53dfe1deb1be497cf6f7e5c6
|
4
|
+
data.tar.gz: f4cc21e109fa18c68b743c351bc01ef07991a133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a461ee413262ac5570b5aba564e000de4be6a54fd7e035cd39139c6dfb7ef4740730ba62832007d5e75fbea23d00961cdda2c513c6d0e3ea4c83a4451e6626b9
|
7
|
+
data.tar.gz: 65fdc8f07dac7d6c9c704cb7fc5a5786ac53f91b44a3812e902d56d39a5496fdf49568032d89d8cfe03da08a170d071a710cae4de6bdabc6c2c0bd2550bdf741
|
@@ -1,6 +1,4 @@
|
|
1
1
|
class User < ActiveRecord::Base
|
2
|
-
# attr_accessible :provider, :uid, :name, :nickname, :image, :email, :location, :token, :secret
|
3
|
-
|
4
2
|
# auth情報更新
|
5
3
|
def auth_update( auth )
|
6
4
|
if auth["provider"] == "facebook"
|
@@ -9,12 +7,13 @@ class User < ActiveRecord::Base
|
|
9
7
|
image_path = auth["info"]["image"]
|
10
8
|
end
|
11
9
|
|
12
|
-
if self.name != auth["info"]["name"] or self.nickname != auth["info"]["nickname"] or self.image != image_path or self.email != auth["info"]["email"]
|
10
|
+
if self.name != auth["info"]["name"] or self.nickname != auth["info"]["nickname"] or self.image != image_path or self.email != auth["info"]["email"]
|
13
11
|
self.name = auth["info"]["name"]
|
14
12
|
self.nickname = auth["info"]["nickname"]
|
15
13
|
self.image = image_path
|
16
14
|
self.email = auth["info"]["email"]
|
17
|
-
self.
|
15
|
+
self.gender = auth["extra"]["raw_info"]["gender"]
|
16
|
+
self.location = auth["info"]["location"] || auth["extra"]["raw_info"]["location"]
|
18
17
|
self.save!
|
19
18
|
end
|
20
19
|
end
|
@@ -40,6 +39,11 @@ class User < ActiveRecord::Base
|
|
40
39
|
user.secret = auth['credentials']['secret']
|
41
40
|
end
|
42
41
|
|
42
|
+
if auth["extra"].present? and auth["extra"]["raw_info"].present?
|
43
|
+
user.gender = auth["extra"]["raw_info"]["gender"]
|
44
|
+
user.location = auth["extra"]["raw_info"]["location"] if user.location.blank?
|
45
|
+
end
|
46
|
+
|
43
47
|
user.save!
|
44
48
|
|
45
49
|
return user
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimum-omniauth-scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shu0115
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|