diff options
author | Brendan Deere <brendangdeere@gmail.com> | 2016-09-28 15:10:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-28 15:10:52 -0700 |
commit | 61c156cf92e0481401ff54350ad23cce1f2a0987 (patch) | |
tree | 49cb602b6352c3c3cea9bd648b3844b9f96e0742 /app/models/solidus_subscriptions/installment.rb | |
parent | 71f5516da549b7d61c3a97e2711eaee40fd5ae64 (diff) | |
parent | 948636c497c9c395bec57f74d7e3533da35ab4fd (diff) |
Merge pull request #47 from brendandeere/rake_task_and_job
Rake task and job
Diffstat (limited to 'app/models/solidus_subscriptions/installment.rb')
-rw-r--r-- | app/models/solidus_subscriptions/installment.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/solidus_subscriptions/installment.rb b/app/models/solidus_subscriptions/installment.rb index 162efb8..de4a734 100644 --- a/app/models/solidus_subscriptions/installment.rb +++ b/app/models/solidus_subscriptions/installment.rb @@ -13,6 +13,11 @@ module SolidusSubscriptions validates :subscription, presence: true + scope :actionable, (lambda do + where("#{table_name}.actionable_date <= ?", Time.zone.now). + where(order_id: nil) + end) + # Get the builder for the subscription_line_item. This will be an # object that can generate the appropriate line item for the subscribable # object |