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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 978399c10de8f705d8bef460bded4c2a596f4e622f27deadc6eabe0d68ec690f
4
- data.tar.gz: faabf03ef0cda1f10e651bc94406e1965cb86161fdcbb303da3f17faceba702e
3
+ metadata.gz: 2af4a30d5895c96dfa6e0b57604155431d3bad1e63545983525a6703f8def2b5
4
+ data.tar.gz: e6d1ab4d19a4eae08bb34da2855a7fe08f582af676933fb0c856ed57e77796e0
5
5
  SHA512:
6
- metadata.gz: 9c8ecd8a69ce9961b10b1cfc49a64876753ce04dd838fd8b2f9ff5288951a7e442c98817f2461dc5b2a321bfdd6d4836e3591ec5741aaa4da45c60477646ecf7
7
- data.tar.gz: 0073c773b8e96ca5a66eb771d22180edd6bed3b42e8c750c989462bd1e73ae94f96a135708ed18ee748cbe039bc7d0042d8c1f6f13f35666d0a31c226221d562
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
@@ -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
@@ -40,6 +40,7 @@ require 'ish/input_error'
40
40
  require 'ish/invoice'
41
41
  require 'ish/issue'
42
42
  require 'ish/lead'
43
+ require 'ish/nonpublic'
43
44
  require 'ish/payment'
44
45
  require 'ish/premium_item'
45
46
  require 'ish/utils'
@@ -2,6 +2,7 @@
2
2
  class Warbler::StockWatch
3
3
  include Mongoid::Document
4
4
  include Mongoid::Timestamps
5
+ store_in collection: 'ish_stock_watches'
5
6
 
6
7
  field :ticker
7
8
 
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.143
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.2.25
174
+ rubygems_version: 3.1.6
174
175
  signing_key:
175
176
  specification_version: 4
176
177
  summary: models of ish