ish_models 0.0.33.28 → 0.0.33.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish_models/stock_watch.rb +21 -0
- data/lib/ish_models.rb +1 -0
- metadata +2 -4
- data/lib/ish_models/trash/profile.rb +0 -5
- data/lib/ish_models/trash/user.rb +0 -125
- data/lib/trash/user_profile.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa01d1be7bc403f51cb43a094d4499f5d051bbd2
|
4
|
+
data.tar.gz: 0326c6a6fddca8a817d1cf5cdd402d60e58592c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5c0134d138343c27a965e4c54b341bfb91f26352a6f0dd05cfa929d264e1bc0b0ff011b956ed1923f4135037c5320c1d347ed14509c7acd8535ce93a58c3a15
|
7
|
+
data.tar.gz: 6abd18e39ca0ce8336d2fac39b1f6925348d1db7458a3ce84973c78108b0dd573830a9ed5678c8e4d528178f53bb4593076f5107d2bf68f0adb95350ab4790a2
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
class IshModels::StockWatch
|
3
|
+
include Mongoid::Document
|
4
|
+
include Mongoid::Timestamps
|
5
|
+
|
6
|
+
field :ticker
|
7
|
+
|
8
|
+
NOTIFICATION_TYPES = [ :EMAIL, :SMS, :NONE ]
|
9
|
+
NOTIFICATION_EMAIL = :EMAIL
|
10
|
+
NOTIFICATION_SMS = :SMS
|
11
|
+
NOTIFICATION_NONE = :NONE
|
12
|
+
field :notification_type, :type => Symbol
|
13
|
+
|
14
|
+
field :price, :type => Float
|
15
|
+
|
16
|
+
DIRECTIONS = [ :ABOVE, :BELOW ]
|
17
|
+
DIRECTION_ABOVE = :ABOVE
|
18
|
+
DIRECTION_BELOW = :BELOW
|
19
|
+
field :direction, :type => Symbol
|
20
|
+
|
21
|
+
end
|
data/lib/ish_models.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.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -69,8 +69,7 @@ files:
|
|
69
69
|
- lib/ish_models/profile.rb~
|
70
70
|
- lib/ish_models/railtie.rb
|
71
71
|
- lib/ish_models/railtie.rb~
|
72
|
-
- lib/ish_models/
|
73
|
-
- lib/ish_models/trash/user.rb
|
72
|
+
- lib/ish_models/stock_watch.rb
|
74
73
|
- lib/ish_models/user.rb~
|
75
74
|
- lib/ish_models/user_profile.rb
|
76
75
|
- lib/manager.rb
|
@@ -80,7 +79,6 @@ files:
|
|
80
79
|
- lib/report.rb
|
81
80
|
- lib/site.rb
|
82
81
|
- lib/tag.rb
|
83
|
-
- lib/trash/user_profile.rb
|
84
82
|
- lib/user_profile.rb~
|
85
83
|
- lib/venue.rb
|
86
84
|
- lib/video.rb
|
@@ -1,125 +0,0 @@
|
|
1
|
-
|
2
|
-
class IshModels::User
|
3
|
-
include Mongoid::Document
|
4
|
-
include Mongoid::Timestamps
|
5
|
-
|
6
|
-
# Setup accessible (or protected) attributes for your model
|
7
|
-
# attr_accessible :email, :password, :password_confirmation, :remember_me
|
8
|
-
|
9
|
-
## Database authenticatable
|
10
|
-
field :email, type: String, default: ""
|
11
|
-
validates :email, :presence => true, :uniqueness => true
|
12
|
-
|
13
|
-
field :encrypted_password, type: String, default: ""
|
14
|
-
|
15
|
-
## Recoverable
|
16
|
-
field :reset_password_token, type: String
|
17
|
-
field :reset_password_sent_at, type: Time
|
18
|
-
|
19
|
-
## Rememberable
|
20
|
-
field :remember_created_at, type: Time
|
21
|
-
|
22
|
-
## Trackable
|
23
|
-
field :sign_in_count, type: Integer, default: 0
|
24
|
-
field :current_sign_in_at, type: Time
|
25
|
-
field :last_sign_in_at, type: Time
|
26
|
-
field :current_sign_in_ip, type: String
|
27
|
-
field :last_sign_in_ip, type: String
|
28
|
-
|
29
|
-
## Confirmable
|
30
|
-
# field :confirmation_token, type: String
|
31
|
-
# field :confirmed_at, type: Time
|
32
|
-
# field :confirmation_sent_at, type: Time
|
33
|
-
# field :unconfirmed_email, type: String # Only if using reconfirmable
|
34
|
-
|
35
|
-
## Lockable
|
36
|
-
# field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
37
|
-
# field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
38
|
-
# field :locked_at, type: Time
|
39
|
-
|
40
|
-
# :recoverable, :trackable :rememberable,
|
41
|
-
# :token_authenticatable,
|
42
|
-
# :lockable, :timeoutable, :confirmable
|
43
|
-
|
44
|
-
# herehere, this was in (now its out)
|
45
|
-
# devise :registerable, :validatable
|
46
|
-
# devise :database_authenticatable, :authentication_keys => [ :email ]
|
47
|
-
|
48
|
-
# devise :omniauthable, :omniauth_providers => [ :facebook ]
|
49
|
-
# devise :encryptable, :encryptor => :sha1base64
|
50
|
-
#
|
51
|
-
#
|
52
|
-
# field :confirmed_at, :type => DateTime
|
53
|
-
# field :confirmation_token, :type => String
|
54
|
-
# field :confirmation_sent_at, :type => DateTime
|
55
|
-
|
56
|
-
field :username, :type => String
|
57
|
-
validates :username, :presence => true, :uniqueness => true
|
58
|
-
|
59
|
-
field :name, :type => String
|
60
|
-
validates :name, :presence => true
|
61
|
-
|
62
|
-
field :group_id, :type => Integer, :default => 3
|
63
|
-
|
64
|
-
field :scratchpad, :type => String
|
65
|
-
field :github_path, :type => String
|
66
|
-
field :facebook_path, :type => String
|
67
|
-
field :stackoverflow_path, :type => String
|
68
|
-
|
69
|
-
field :is_feature, :type => Boolean, :default => false
|
70
|
-
field :is_trash, :type => Boolean, :default => false
|
71
|
-
|
72
|
-
field :display_ads, :type => Boolean, :default => true
|
73
|
-
field :display_help, :type => Boolean, :default => true
|
74
|
-
|
75
|
-
has_many :reports
|
76
|
-
has_many :photos
|
77
|
-
# has_many :user_profiles
|
78
|
-
has_many :galleries
|
79
|
-
has_many :videos
|
80
|
-
|
81
|
-
has_one :profile_photo, :class_name => 'Photo', :inverse_of => :profile_user
|
82
|
-
|
83
|
-
has_and_belongs_to_many :viewable_photos, :class_name => 'Photo', :inverse_of => :viewer
|
84
|
-
|
85
|
-
belongs_to :guide_city, :class_name => 'City', :inverse_of => :guide
|
86
|
-
belongs_to :current_city, :class_name => 'City', :inverse_of => :city_users
|
87
|
-
|
88
|
-
def self.list conditions = { :is_trash => false }
|
89
|
-
out = self.where( conditions ).order_by( :name => :asc )
|
90
|
-
[['', nil]] + out.map { |item| [ item.name, item.id ] }
|
91
|
-
end
|
92
|
-
|
93
|
-
embeds_many :newsitems
|
94
|
-
|
95
|
-
def self.all
|
96
|
-
self.where( :is_trash => false ).order_by( :created_at => :desc )
|
97
|
-
end
|
98
|
-
|
99
|
-
def create_newsitem args = {}
|
100
|
-
unless args[:photo].blank?
|
101
|
-
n = Newsitem.new
|
102
|
-
n.photo = args[:photo]
|
103
|
-
n.descr = 'uploaded new photo on'
|
104
|
-
n.username = self.username
|
105
|
-
self.newsitems << n
|
106
|
-
self.save
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def self.per_page
|
111
|
-
16
|
112
|
-
end
|
113
|
-
|
114
|
-
def self.clear
|
115
|
-
if Rails.env.test?
|
116
|
-
User.unscoped.each { |u| u.remove }
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
def generate_auth_token
|
121
|
-
payload = { user_id: self.id }
|
122
|
-
AuthToken.encode(payload)
|
123
|
-
end
|
124
|
-
|
125
|
-
end
|