ish_models 0.0.33.100 → 0.0.33.103

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: 85ec8f93f2b74844ebc29d4aee62b2c28e5aea5822561f917fc0be0a9715152f
4
- data.tar.gz: dc60145e4f1b93a3761da7e38d1434d3ba7d7fbf93e0c9d778cd1459c947f587
3
+ metadata.gz: 6265d6ad8a5d5e85aad412b57b2f7751ff8816ea14e1743ab34891532f6f4cf4
4
+ data.tar.gz: '08a2fa3206ca39253963aaac1ded20924328e798a5beb0e6034a80cf1b47ee4a'
5
5
  SHA512:
6
- metadata.gz: fad2c0a0314143161f830c3b813d4d7436162d9e2ad583d2692578c69305a23b00f09707a8af020212adcbd29cb0544dfa4e52941c0886bcfd878bacb18dbf26
7
- data.tar.gz: a0ae18165c3b4f9f7bcbe0f60e3dc44221695f35068cdd0e764e81904a155b3c475011b0a984e9e95aeb709cb071d86e0550648e6e6235566e415ed5ff1fc620
6
+ metadata.gz: 92e56359fae99ccb144e90eee2e0c8d8bc19d7403528fe9f58ff90a2fe2ba4270861f33e95524597ef9e938de4c569dc8ab74feeccb1030013f81a33e733c297
7
+ data.tar.gz: f3128b3ef46bdfd56b696220a0f95a1c88c2fd012afbf80f15d1a3f0a26a9afb22b737f3efd68bd7bab8957df8c9650d3256b1bbd8fc8b2e7a860e8a6cb0898d
data/lib/ish/invoice.rb CHANGED
@@ -16,10 +16,10 @@ class Ish::Invoice
16
16
  field :number, :type => Integer
17
17
  increments :number
18
18
 
19
- field :amount, :type => Float
19
+ field :amount, :type => Integer
20
20
 
21
21
  has_many :payments, :class_name => 'Ish::Payment'
22
- field :paid_amount, :type => Float, :default => 0
22
+ field :paid_amount, :type => Integer, :default => 0
23
23
 
24
24
  field :description, :type => String
25
25
 
data/lib/ish/payment.rb CHANGED
@@ -2,10 +2,10 @@ class Ish::Payment
2
2
  include Mongoid::Document
3
3
  include Mongoid::Timestamps
4
4
 
5
- belongs_to :invoice, :class_name => 'Ish::Invoice'
6
- # belongs_to :profile, :class_name => 'IshModels::UserProfile', :optional => true
5
+ belongs_to :invoice, :class_name => 'Ish::Invoice', optional: true
6
+ belongs_to :profile, :class_name => 'IshModels::UserProfile' # , :optional => true
7
7
 
8
- field :amount, :type => Float
8
+ field :amount, :type => Integer # in cents
9
9
  field :charge, :type => Hash
10
10
  field :email, :type => String
11
11
 
@@ -14,7 +14,9 @@ class Ish::Payment
14
14
  protected
15
15
 
16
16
  def compute_paid_invoice_amount
17
- self.invoice.update_attributes :paid_amount => self.invoice.paid_amount + self.amount
17
+ if self.invoice
18
+ self.invoice.update_attributes :paid_amount => self.invoice.paid_amount + self.amount
19
+ end
18
20
  end
19
21
 
20
22
  end
@@ -75,4 +75,9 @@ class IshModels::UserProfile
75
75
  self.orders.where( :submitted_at => nil ).first || CoTailors::Order.create( :profile => self )
76
76
  end
77
77
 
78
+ #
79
+ # GameUI
80
+ #
81
+ field :n_stars, type: Integer, default: 0
82
+
78
83
  end
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.100
4
+ version: 0.0.33.103
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox