ish_models 0.0.33.68 → 0.0.33.69
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gallery.rb +3 -0
- data/lib/ish/invoice.rb +2 -1
- data/lib/ish/payment.rb +9 -1
- metadata +1 -10
- data/lib/cache_key.rb~ +0 -10
- data/lib/cities_user.rb~ +0 -17
- data/lib/ish_models.rb~ +0 -11
- data/lib/ish_models/cache_key.rb~ +0 -13
- data/lib/ish_models/configuration.rb~ +0 -5
- data/lib/ish_models/profile.rb~ +0 -0
- data/lib/ish_models/railtie.rb~ +0 -6
- data/lib/ish_models/user.rb~ +0 -122
- data/lib/user_profile.rb~ +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c974f7f7d2f077d558b554b718e59d128d08050
|
4
|
+
data.tar.gz: aeb535af35227c313e2c5d8111bd979919b2b09f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b43c44d5dc296dafd4f370d61602b7d6549c41e6f34e56d3c565a019fca35387b939b3b6cc14c1c2a0e3da9da41f5623d6ee37b93b7e19cbc80f56b741f15877
|
7
|
+
data.tar.gz: 472306420a2730c59d1bdd39611c86132901d7400bd702f1e6974aea718c1a7f424a5016acc6450a1eea82a089e656c05b128786d52d79749ef14fda31ed0282
|
data/lib/gallery.rb
CHANGED
data/lib/ish/invoice.rb
CHANGED
@@ -11,7 +11,7 @@ class Ish::Invoice
|
|
11
11
|
|
12
12
|
store_in :collection => 'ish_invoice'
|
13
13
|
|
14
|
-
|
14
|
+
field :email, :type => String
|
15
15
|
|
16
16
|
field :number, :type => Integer
|
17
17
|
increments :number
|
@@ -19,6 +19,7 @@ class Ish::Invoice
|
|
19
19
|
field :amount, :type => Float
|
20
20
|
|
21
21
|
has_many :payments, :class_name => 'Ish::Payment'
|
22
|
+
field :paid_amount, :type => Float, :default => 0
|
22
23
|
|
23
24
|
field :description, :type => String
|
24
25
|
|
data/lib/ish/payment.rb
CHANGED
@@ -3,10 +3,18 @@ class Ish::Payment
|
|
3
3
|
include Mongoid::Timestamps
|
4
4
|
|
5
5
|
belongs_to :invoice, :class_name => 'Ish::Invoice'
|
6
|
-
belongs_to :profile, :class_name => 'IshModels::UserProfile', :optional => true
|
6
|
+
# belongs_to :profile, :class_name => 'IshModels::UserProfile', :optional => true
|
7
7
|
|
8
8
|
field :amount, :type => Float
|
9
9
|
field :charge, :type => Hash
|
10
10
|
|
11
|
+
after_create :compute_paid_invoice_amount
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
def compute_paid_invoice_amount
|
16
|
+
self.invoice.update_attributes :paid_amount => self.invoice.paid_amount + self.amount
|
17
|
+
end
|
18
|
+
|
11
19
|
end
|
12
20
|
|
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.69
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -108,9 +108,7 @@ extra_rdoc_files: []
|
|
108
108
|
files:
|
109
109
|
- lib/app_model2.rb
|
110
110
|
- lib/aux_model.rb
|
111
|
-
- lib/cache_key.rb~
|
112
111
|
- lib/cities_user.rb
|
113
|
-
- lib/cities_user.rb~
|
114
112
|
- lib/city.rb
|
115
113
|
- lib/co_tailors.rb
|
116
114
|
- lib/co_tailors/address.rb
|
@@ -133,16 +131,10 @@ files:
|
|
133
131
|
- lib/ish/stock_option.rb
|
134
132
|
- lib/ish/stock_watch.rb
|
135
133
|
- lib/ish_models.rb
|
136
|
-
- lib/ish_models.rb~
|
137
134
|
- lib/ish_models/cache_key.rb
|
138
|
-
- lib/ish_models/cache_key.rb~
|
139
135
|
- lib/ish_models/configuration.rb
|
140
|
-
- lib/ish_models/configuration.rb~
|
141
|
-
- lib/ish_models/profile.rb~
|
142
136
|
- lib/ish_models/railtie.rb
|
143
|
-
- lib/ish_models/railtie.rb~
|
144
137
|
- lib/ish_models/stock_watch.rb
|
145
|
-
- lib/ish_models/user.rb~
|
146
138
|
- lib/ish_models/user_profile.rb
|
147
139
|
- lib/manager.rb
|
148
140
|
- lib/newsitem.rb
|
@@ -151,7 +143,6 @@ files:
|
|
151
143
|
- lib/report.rb
|
152
144
|
- lib/site.rb
|
153
145
|
- lib/tag.rb
|
154
|
-
- lib/user_profile.rb~
|
155
146
|
- lib/venue.rb
|
156
147
|
- lib/video.rb
|
157
148
|
homepage: http://wasya.co
|
data/lib/cache_key.rb~
DELETED
data/lib/cities_user.rb~
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
|
2
|
-
class CitiesUser
|
3
|
-
|
4
|
-
include Mongoid::Document
|
5
|
-
include Mongoid::Timestamps
|
6
|
-
|
7
|
-
field :date, :type => Time
|
8
|
-
field :name, :type => String
|
9
|
-
field :descr, :type => String
|
10
|
-
|
11
|
-
belongs_to :city
|
12
|
-
belongs_to :user
|
13
|
-
|
14
|
-
has_many :reports
|
15
|
-
has_many :galleries
|
16
|
-
|
17
|
-
end
|
data/lib/ish_models.rb~
DELETED
data/lib/ish_models/profile.rb~
DELETED
File without changes
|
data/lib/ish_models/railtie.rb~
DELETED
data/lib/ish_models/user.rb~
DELETED
@@ -1,122 +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
|
-
devise :registerable, :validatable
|
44
|
-
devise :database_authenticatable, :authentication_keys => [ :email ]
|
45
|
-
# devise :omniauthable, :omniauth_providers => [ :facebook ]
|
46
|
-
# devise :encryptable, :encryptor => :sha1base64
|
47
|
-
#
|
48
|
-
#
|
49
|
-
# field :confirmed_at, :type => DateTime
|
50
|
-
# field :confirmation_token, :type => String
|
51
|
-
# field :confirmation_sent_at, :type => DateTime
|
52
|
-
|
53
|
-
field :username, :type => String
|
54
|
-
validates :username, :presence => true, :uniqueness => true
|
55
|
-
|
56
|
-
field :name, :type => String
|
57
|
-
validates :name, :presence => true
|
58
|
-
|
59
|
-
field :group_id, :type => Integer, :default => 3
|
60
|
-
|
61
|
-
field :scratchpad, :type => String
|
62
|
-
field :github_path, :type => String
|
63
|
-
field :facebook_path, :type => String
|
64
|
-
field :stackoverflow_path, :type => String
|
65
|
-
|
66
|
-
field :is_feature, :type => Boolean, :default => false
|
67
|
-
field :is_trash, :type => Boolean, :default => false
|
68
|
-
|
69
|
-
field :display_ads, :type => Boolean, :default => true
|
70
|
-
field :display_help, :type => Boolean, :default => true
|
71
|
-
|
72
|
-
has_many :reports
|
73
|
-
has_many :photos
|
74
|
-
has_many :user_profiles
|
75
|
-
has_many :galleries
|
76
|
-
has_many :videos
|
77
|
-
|
78
|
-
has_one :profile_photo, :class_name => 'Photo', :inverse_of => :profile_user
|
79
|
-
|
80
|
-
has_and_belongs_to_many :viewable_photos, :class_name => 'Photo', :inverse_of => :viewer
|
81
|
-
|
82
|
-
belongs_to :guide_city, :class_name => 'City', :inverse_of => :guide
|
83
|
-
belongs_to :current_city, :class_name => 'City', :inverse_of => :city_users
|
84
|
-
|
85
|
-
def self.list conditions = { :is_trash => false }
|
86
|
-
out = self.where( conditions ).order_by( :name => :asc )
|
87
|
-
[['', nil]] + out.map { |item| [ item.name, item.id ] }
|
88
|
-
end
|
89
|
-
|
90
|
-
embeds_many :newsitems
|
91
|
-
|
92
|
-
def self.all
|
93
|
-
self.where( :is_trash => false ).order_by( :created_at => :desc )
|
94
|
-
end
|
95
|
-
|
96
|
-
def create_newsitem args = {}
|
97
|
-
unless args[:photo].blank?
|
98
|
-
n = Newsitem.new
|
99
|
-
n.photo = args[:photo]
|
100
|
-
n.descr = 'uploaded new photo on'
|
101
|
-
n.username = self.username
|
102
|
-
self.newsitems << n
|
103
|
-
self.save
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def self.per_page
|
108
|
-
16
|
109
|
-
end
|
110
|
-
|
111
|
-
def self.clear
|
112
|
-
if Rails.env.test?
|
113
|
-
User.unscoped.each { |u| u.remove }
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def generate_auth_token
|
118
|
-
payload = { user_id: self.id }
|
119
|
-
AuthToken.encode(payload)
|
120
|
-
end
|
121
|
-
|
122
|
-
end
|