wbase 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: f2a2ce64018fa7285e77fd37b50adb56a0d0dca4
4
- data.tar.gz: cbfccc3d16900024662c65baabd862b24ff7b866
3
+ metadata.gz: c3f6a645ab1e6cdec65adf7da7de4ddc86f88e5f
4
+ data.tar.gz: 823fca99636f4fc882eb435f20aa230857502b8b
5
5
  SHA512:
6
- metadata.gz: c3fa34cf39dee3696b56bb0196c1b84894fe6444b6674f92a1a522d84778431ff9e79b02b0c7461e381c1c45c02ce65bccd6f8c9b161b0511664bd1326254da3
7
- data.tar.gz: aaa2909a362f52da5068ff74c5bba2ba01d0bc1cd2d4e31ce56ce598c0ebbf39da30f7557f1c3e9420bbd5a85a1e6b897a74cc4ca75cfbc4820a9518cc15e986
6
+ metadata.gz: e28230f3caac64c6805b2bdd9c75ecd8178f5f0351dbae68acd581b85622060414fa76c50b1c5e796fe63ea8f9115a8fedb42ff959e1230de36a0eabbc0fc25f
7
+ data.tar.gz: 6636d2ac437b1f627460012931f41e2194febb4c0705c01b27e32b3fd0355c4bca3cd7eba280ecf27cd40c1749e48c9be14dfe78ef193c22086b13342a4c593a
@@ -30,5 +30,13 @@ module Wbase
30
30
  def self.annual
31
31
  where("interval LIKE '%yearly%'")
32
32
  end
33
+
34
+ def monthly?
35
+ interval.include?('month')
36
+ end
37
+
38
+ def annual?
39
+ interval.include?('year')
40
+ end
33
41
  end
34
42
  end
@@ -29,7 +29,11 @@ module Wbase
29
29
  Wbase::Subscription.new(@params) do |s|
30
30
  s.user = user
31
31
  s.current_price = s.plan.price
32
- s.paid_thru = 30.days.from_now
32
+ if s.plan.monthly?
33
+ s.paid_thru = 30.days.from_now
34
+ else
35
+ s.paid_thru = 12.months.from_now
36
+ end
33
37
  end
34
38
  end
35
39
 
data/lib/wbase/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wbase
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
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.1
4
+ version: 0.3.2
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-01-16 00:00:00.000000000 Z
11
+ date: 2017-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails