ish_models 0.0.33.224 → 0.0.33.226

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: 50675cc51e51d76bc4b1b20396f6aaa5cc21d44f8517a9f419ba64651ab47f3a
4
- data.tar.gz: '08e520ea0df95f8fb0ae157d4b8ca1658d1d144bb02533fa14f4e11ecad35fa7'
3
+ metadata.gz: 02f2fdc590d67f5ad6513008477007b86c0138afa96e4209eb6b1f1997378425
4
+ data.tar.gz: 8ab4cc3c068c5b7aa92310d8aa357897e91dfde2db493f4c09f4904785df5699
5
5
  SHA512:
6
- metadata.gz: 49900207ca24ec6708fa9842a284d761e4d4b095dc0ce36374a14ed4a0014ba858461c5f6febc0813350fc5195f1c31c0bc3e577e0aed6ef7a8db4e4bdd370e1
7
- data.tar.gz: fbaab4658c3c2d6370b71156543b4ee592b341c55862e9c708fdd8eec1071de4ca191211c23243c11c5fe8863e7eba92f84039db31bca50746c02145ebb82e87
6
+ metadata.gz: 91667162849af81e259b3455aa6d4174780d649d7af795dde6679f12c2cb536457ce82e341a52033cb3a55780481a965d3dc8d0a88319762ba4cb5446d631e0a
7
+ data.tar.gz: 64991ebc764353e7f1635642b4995881e706ea7a11336583098316890f35b6ed4462170ca92b53ce7d8e5c408a8bd3286619fb3b0f7a90341cf1d2c41ea2ae6f
@@ -47,5 +47,10 @@ class ::Ish::EmailTemplate
47
47
  has_many :email_actions, class_name: '::Office::EmailAction'
48
48
  has_many :email_contexts, class_name: '::Ish::EmailContext'
49
49
 
50
+ SLUG_BLANK = 'blank'
51
+ def self.blank_template
52
+ out = Tmpl.find_or_create_by({ slug: SLUG_BLANK })
53
+ end
54
+
50
55
  end
51
56
  ::Tmpl = ::Ish::EmailTemplate
data/lib/ish/payment.rb CHANGED
@@ -14,7 +14,11 @@ class Ish::Payment
14
14
  field :client_secret
15
15
  field :payment_intent_id
16
16
 
17
- field :status, type: Symbol
17
+ STATUS_CONFIRMED = 'confirmed'
18
+ STATUS_PENDING = 'pending'
19
+ STATUSES = %w| active pending |
20
+ field :status, type: Symbol, default: STATUS_PENDING
21
+ scope :confirmed, ->{ where( status: STATUS_CONFIRMED ) }
18
22
 
19
23
  after_create :compute_paid_invoice_amount
20
24
  def compute_paid_invoice_amount
@@ -69,7 +69,7 @@ class Ish::UserProfile
69
69
  has_many :payments, :class_name => '::Ish::Payment'
70
70
 
71
71
  def has_premium_purchase item
72
- payments.where( item: item ).exists?
72
+ payments.confirmed.where( item: item ).exists?
73
73
  end
74
74
 
75
75
  field :is_purchasing, type: Boolean, default: false
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.224
4
+ version: 0.0.33.226
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox