wbase 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8b7267ae68a8d23ffb06b86500da19abe87eceb
4
- data.tar.gz: 116c552a0b2c659a04d376c102c4dd8ae59c1b80
3
+ metadata.gz: 2fc1b31c1bad008c9385eea4f1b18bbfa4fdaf53
4
+ data.tar.gz: 8ede718e893069afdedffdc3c814256ad628319c
5
5
  SHA512:
6
- metadata.gz: 3881fe18e1969423ef46ddd51eecd9c06efa411aeae4ac78505d919fa7138a7a5ff5ea743455a298adf6a8dd1a4be876a9a67cea230e7ebb11a4e5be7d7a7202
7
- data.tar.gz: ab8f977627a9275c91ae77a38a501290baf5a3aa7a95b804b40d7c9899f7780ea1756e4cf5049ce4c11c298c2bc876802a7431aa5992a50e8a8671d83ae03fee
6
+ metadata.gz: cd9c72e591182dff9cba0297db769861eb87329d2f46eb72e772771621e683d8abb5959c63cd3d2916b95784ac1e2eb475f8474324e9caf2aebbc5d38167696b
7
+ data.tar.gz: 2152b79398bb3a95cea228d6673875437ba0d40bb908fc86b800ae84ee7e1d1d120d6ad1e41140e3323c1ec41004243ca27eb1e5795926f83c1aeb59a16e17c1
@@ -65,7 +65,19 @@ module Wbase
65
65
  end
66
66
 
67
67
  def subscribed?
68
- trial? || (subscription && subscription.current?)
68
+ return true if trial?
69
+ active_subscriptions = subscriptions.where('paid_thru > ?', 7.days.ago)
70
+ return true if active_subscriptions.exists?
71
+ subscriptions.each do |sub|
72
+ if sub.update_paid_thru! && sub.paid_thru > 7.days.ago
73
+ return true
74
+ end
75
+ end
76
+ false
77
+ end
78
+
79
+ def subscriptions
80
+ Subscription.where(user: self)
69
81
  end
70
82
 
71
83
  def trial?
data/lib/wbase/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wbase
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - CJ Avilla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-05 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails