ish_models 0.0.33.144 → 0.0.33.148

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: 2807ebb262080febaab78c66087d7ef4836ee6f765ce6a41aa828f9a042ccc28
4
- data.tar.gz: 5674a4862d01ce30240aaefc7654e98a9343d69f0711fa095ccf009800416299
3
+ metadata.gz: 84cc3820b6d71d08c41b6f903b82547dc048150f15a9beb76daf0dd0e17d91dc
4
+ data.tar.gz: db8ea548690613d03cde7eb754c48ed86684184af3f7ef882b5329a822907d92
5
5
  SHA512:
6
- metadata.gz: b70f70184a0ac44ee02268fed7a99f0a02113f6a2f81287d5bb18d461bf13d58f495140700cd60b2271e11b8098ca9570280ae3bc5860b0426ead9044ca90abb
7
- data.tar.gz: 6523e5eace38f3781478866a99de46d6ea01842162e07d91d5e4aebaf935872440cda597f3bae37c7e62900084679bac6eae6bda300a6d9d6093aa656f8afd3b
6
+ metadata.gz: d15d489470b5af11cd24a764578b23631819863b62800d99cd1ea4a5dc949df19af41af4948f4310ebf1738c9a3d18970d3b4925b69025b8885de48a7521aa68
7
+ data.tar.gz: 1b7fc6f63626ae2b9ebc7e97adc48b1267d4dbcf7b328dae1bdd1aec53e163864bd2bd0a429effc6e5790ccfa0942c31ceebd35861617abaad47723682ef3be7
@@ -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
@@ -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
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'
data/lib/video.rb CHANGED
@@ -2,16 +2,17 @@ class Video
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
4
  include Mongoid::Paperclip
5
+ include Mongoid::Paranoia
5
6
 
6
7
  PER_PAGE = 6
7
8
 
8
9
  field :name, :type => String
9
10
  field :descr, :type => String, :as => :description
10
11
 
11
- default_scope ->{ where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc }) }
12
+ # default_scope ->{ where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc }) }
12
13
 
13
14
  field :is_trash, :type => Boolean, :default => false
14
- field :is_public, :type => Boolean, :default => true
15
+ field :is_public, :type => Boolean, :default => false
15
16
  field :is_feature, :type => Boolean, :default => false
16
17
 
17
18
  field :x, :type => Float
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.144
4
+ version: 0.0.33.148
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 7.0.5
27
+ - !ruby/object:Gem::Dependency
28
+ name: mongoid_paranoia
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: mongoid-autoinc
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +142,7 @@ files:
128
142
  - lib/ish/invoice.rb
129
143
  - lib/ish/issue.rb
130
144
  - lib/ish/lead.rb
145
+ - lib/ish/nonpublic.rb
131
146
  - lib/ish/payment.rb
132
147
  - lib/ish/premium_item.rb
133
148
  - lib/ish/railtie.rb
@@ -151,9 +166,9 @@ files:
151
166
  - lib/warbler/stock_option.rb
152
167
  - lib/warbler/stock_watch.rb
153
168
  - lib/warbler/yahoo_stockwatcher.rb
154
- homepage: http://wasya.co
169
+ homepage: https://wasya.co
155
170
  licenses:
156
- - MIT
171
+ - Proprietary
157
172
  metadata: {}
158
173
  post_install_message:
159
174
  rdoc_options: []
@@ -170,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
185
  - !ruby/object:Gem::Version
171
186
  version: '0'
172
187
  requirements: []
173
- rubygems_version: 3.2.25
188
+ rubygems_version: 3.1.6
174
189
  signing_key:
175
190
  specification_version: 4
176
191
  summary: models of ish