ish_models 0.0.33.145 → 0.0.33.149
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gameui/map.rb +0 -2
- data/lib/gameui/marker.rb +2 -1
- data/lib/ish/user_profile.rb +27 -0
- data/lib/video.rb +11 -2
- data/lib/warbler/stock_watch.rb +1 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af77cb84fd5fe123e232d66b36e090ed15f5a98c4ce97cfa49d8d1a0717f83d9
|
4
|
+
data.tar.gz: fd202da5dfb24c5850781b49a8965d4c266f02529917721a20864dea5491c4b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '098f8e1013de0d59e3ebec5478b98147e5bdc166fc9ad03989c4af64cc4680f26fbda13f408f3dc919ce936654f875a469d91194ae94fef8e9b670feca1d7ec0'
|
7
|
+
data.tar.gz: b58f6e2a99d512afd89dcf0626cb69b0746a02c087fd7a7f179d7386974b9ee4a0d61be58c985c1df92c1ba0719e4ee1bc5b8beedf4e44d2f8e135199920c070
|
data/lib/gameui/map.rb
CHANGED
@@ -24,8 +24,6 @@ class ::Gameui::Map
|
|
24
24
|
# shareable, nonpublic
|
25
25
|
field :is_public, type: Boolean, default: true
|
26
26
|
has_and_belongs_to_many :shared_profiles, :class_name => 'Ish::UserProfile', :inverse_of => :shared_locations
|
27
|
-
default_scope ->{ where({ is_public: true, deleted_at: nil }).order_by({ slug: :desc }) }
|
28
|
-
## @TODO: index default scope, maybe instead of HABTM, use :thru for shared profiles. Make is poly anyway?
|
29
27
|
|
30
28
|
|
31
29
|
field :map_slug
|
data/lib/gameui/marker.rb
CHANGED
@@ -60,7 +60,8 @@ class ::Gameui::Marker
|
|
60
60
|
|
61
61
|
ITEM_TYPE_LOCATION = 'gameui-location'
|
62
62
|
ITEM_TYPE_MAP = 'gameui-map'
|
63
|
-
|
63
|
+
ITEM_TYPE_OBJ = 'gameui-obj'
|
64
|
+
ITEM_TYPES = [ ITEM_TYPE_LOCATION, ITEM_TYPE_MAP, ITEM_TYPE_OBJ ]
|
64
65
|
field :item_type, type: String
|
65
66
|
validates :item_type, presence: true
|
66
67
|
|
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/video.rb
CHANGED
@@ -2,16 +2,25 @@ 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
|
-
|
15
|
+
def is_trash
|
16
|
+
if deleted_at
|
17
|
+
true
|
18
|
+
else
|
19
|
+
self[:is_trash]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
field :is_public, :type => Boolean, :default => false
|
15
24
|
field :is_feature, :type => Boolean, :default => false
|
16
25
|
|
17
26
|
field :x, :type => Float
|
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.149
|
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
|
@@ -152,9 +166,9 @@ files:
|
|
152
166
|
- lib/warbler/stock_option.rb
|
153
167
|
- lib/warbler/stock_watch.rb
|
154
168
|
- lib/warbler/yahoo_stockwatcher.rb
|
155
|
-
homepage:
|
169
|
+
homepage: https://wasya.co
|
156
170
|
licenses:
|
157
|
-
-
|
171
|
+
- Proprietary
|
158
172
|
metadata: {}
|
159
173
|
post_install_message:
|
160
174
|
rdoc_options: []
|
@@ -171,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
185
|
- !ruby/object:Gem::Version
|
172
186
|
version: '0'
|
173
187
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
188
|
+
rubygems_version: 3.1.6
|
175
189
|
signing_key:
|
176
190
|
specification_version: 4
|
177
191
|
summary: models of ish
|