ish_models 0.0.33.146 → 0.0.33.147
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish/user_profile.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2af4a30d5895c96dfa6e0b57604155431d3bad1e63545983525a6703f8def2b5
|
4
|
+
data.tar.gz: e6d1ab4d19a4eae08bb34da2855a7fe08f582af676933fb0c856ed57e77796e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2be04cc815e921d2807dffe0ad15feadeeec327b72cacbef49b96b505d85c4870f0d45d5293749db8c05dad2163e1874fc1e2d70c2b33ba12deee38cd8c96f84
|
7
|
+
data.tar.gz: c8611fdae51db950f7b218e52cbafebaeada3416d535392c91a628ce7aaa8adc6b17fb793af20f1496887dc23ca7cda83beb483665de797cbf1eaae6d14056f2
|
data/lib/ish/user_profile.rb
CHANGED
@@ -81,4 +81,30 @@ class Ish::UserProfile
|
|
81
81
|
::Gameui::PremiumPurchase.where( user_profile_id: self.id )
|
82
82
|
end
|
83
83
|
|
84
|
+
# used in rake tasks
|
85
|
+
def self.generate delta
|
86
|
+
email = delta[:email]
|
87
|
+
password = delta[:password]
|
88
|
+
role_name = delta[:role_name]
|
89
|
+
|
90
|
+
profile = Ish::UserProfile.where( email: email ).first
|
91
|
+
if profile
|
92
|
+
puts! profile, "UserProfile#generate, already exists"
|
93
|
+
return
|
94
|
+
end
|
95
|
+
|
96
|
+
user = User.where( email: email ).first
|
97
|
+
if !user
|
98
|
+
user = User.new({ email: email, password: password })
|
99
|
+
end
|
100
|
+
profile = Ish::UserProfile.new({ email: email, name: email, role_name: role_name, user: user })
|
101
|
+
profile.save
|
102
|
+
|
103
|
+
if profile.persisted?
|
104
|
+
;
|
105
|
+
else
|
106
|
+
puts! profile.errors.full_messages, "Cannot save profile"
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
84
110
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.33.
|
4
|
+
version: 0.0.33.147
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
174
|
+
rubygems_version: 3.1.6
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: models of ish
|