pay 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pay might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 443dcdd7e96a0fbb00363d9c88ffadbda49c64a60f0890b369580ec3e43d70d9
4
- data.tar.gz: dfbeb0f056ced60e76543268027aa939a2a5858eea42f8d9c01201601dc3dbb1
3
+ metadata.gz: 2bde9d6a59e8bb2433c706309b09737bf46039ebc02f271b99923658ca3c3953
4
+ data.tar.gz: 0ef88d80eee2e59e4bcf6a52d8754cb602ea0aa54ba0818ac29361ac8cd3e06c
5
5
  SHA512:
6
- metadata.gz: 9364bc09acaebd1b5ad5f2bed2163b40a02f3895556546b93cc3bfca8a4e6001fb2b8b8024cd601324df6de01006f1de1d6290d1f288aa748561b4e824e1c942
7
- data.tar.gz: e8038d784db23c0117a062585f90c44c019740cfdf381ca953b90e88af0a9d3dd7bae79061017cc2068828fff291f13bab26629872243092f3ee1e83620b3d12
6
+ metadata.gz: 73714b5b94113338beab99427ea82378b0f7de541f414662f15977e3470bc3cd3fe5069276e4fdbacf9617ffd189cd38a5eb6dc5a9d2668daa99eec964eb1936
7
+ data.tar.gz: 333b4d632b7cd1636928eabd29388542b92839ef6f9e2fedb2bd658536fd2ebc8a40a3ca7c41fb1a3974c2d3b9566f5e74da2a71a2106e36afce01b2ea8a83d9
data/README.md CHANGED
@@ -278,6 +278,21 @@ user = User.find_by(email: 'gob@bluthcompany.co')
278
278
  user.subscription(name: 'bananastand+')
279
279
  ```
280
280
 
281
+ #### Checking a User's Trial/Subscription Status
282
+
283
+ ```ruby
284
+ user = User.find_by(email: 'george.senior@bluthcompany.co')
285
+ user.on_trial_or_subscribed?
286
+ ```
287
+
288
+ The `on_trial_or_subscribed?` method has two optional arguments with default values.
289
+
290
+ ```ruby
291
+ def on_trial_or_subscribed?(name: 'default', plan: nil)
292
+ ...
293
+ end
294
+ ```
295
+
281
296
  #### Checking a User's Subscription Status
282
297
 
283
298
  ```ruby
data/lib/pay/billable.rb CHANGED
@@ -76,6 +76,11 @@ module Pay
76
76
  subscription.active? && subscription.processor_plan == processor_plan
77
77
  end
78
78
 
79
+ def on_trial_or_subscribed?(name: 'default', processor_plan: nil)
80
+ on_trial?(name: name, plan: processor_plan) ||
81
+ subscribed?(name: name, processor_plan: processor_plan)
82
+ end
83
+
79
84
  def subscription(name: 'default')
80
85
  subscriptions.for_name(name).last
81
86
  end
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes
@@ -296,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  - !ruby/object:Gem::Version
297
297
  version: '0'
298
298
  requirements: []
299
- rubygems_version: 3.0.3
299
+ rubygems_version: 3.0.6
300
300
  signing_key:
301
301
  specification_version: 4
302
302
  summary: A Ruby on Rails subscription engine.