ish_models 0.0.33.143 → 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/nonpublic.rb +13 -0
- data/lib/ish/user_profile.rb +27 -0
- data/lib/ish_models.rb +1 -0
- data/lib/warbler/stock_watch.rb +1 -0
- metadata +3 -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
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
## THIS IS TRASH. I copy-paste repetitively instead!
|
3
|
+
|
4
|
+
## aka: Ish::Shareable
|
5
|
+
## adds is_public (default true) and #shared_profiles, inverse :shared_items ???
|
6
|
+
module Ish::Nonpublic
|
7
|
+
|
8
|
+
def self.included base
|
9
|
+
base.send :field, :is_public, type: Boolean, default: true
|
10
|
+
base.send :has_and_belongs_to_many, :shared_profiles, :class_name => 'Ish::UserProfile', :inverse_of => :shared_markers
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
data/lib/ish/user_profile.rb
CHANGED
@@ -6,6 +6,7 @@ class Ish::UserProfile
|
|
6
6
|
validates_presence_of :name
|
7
7
|
|
8
8
|
field :username
|
9
|
+
field :scratchpad
|
9
10
|
|
10
11
|
field :email
|
11
12
|
# validates_format_of :email, :with => ::Devise::email_regexp
|
@@ -80,4 +81,30 @@ class Ish::UserProfile
|
|
80
81
|
::Gameui::PremiumPurchase.where( user_profile_id: self.id )
|
81
82
|
end
|
82
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
|
+
|
83
110
|
end
|
data/lib/ish_models.rb
CHANGED
data/lib/warbler/stock_watch.rb
CHANGED
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
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/ish/invoice.rb
|
129
129
|
- lib/ish/issue.rb
|
130
130
|
- lib/ish/lead.rb
|
131
|
+
- lib/ish/nonpublic.rb
|
131
132
|
- lib/ish/payment.rb
|
132
133
|
- lib/ish/premium_item.rb
|
133
134
|
- lib/ish/railtie.rb
|
@@ -170,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
171
|
- !ruby/object:Gem::Version
|
171
172
|
version: '0'
|
172
173
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
174
|
+
rubygems_version: 3.1.6
|
174
175
|
signing_key:
|
175
176
|
specification_version: 4
|
176
177
|
summary: models of ish
|