Skip to content

Commit 0298cc4

Browse files
committed
Add subscriptions to plan
1 parent fd13662 commit 0298cc4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/plan.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
# rename currency to price_currency
66

77
class Plan < ActiveRecord::Base
8-
#FIXME: this is not working , the subscription model is a mailer
9-
# has_many :subscriptions
8+
has_many :subscriptions , class_name: 'Teams::AccountPlan'
109

1110
after_create :register_on_stripe
1211
after_destroy :unregister_from_stripe

spec/models/plan_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'spec_helper'
22

33
RSpec.describe Plan, :type => :model do
4+
it {is_expected.to have_many(:subscriptions)}
45
it {is_expected.to validate_presence_of(:amount)}
56
it {is_expected.to validate_presence_of(:name)}
67
it {is_expected.to validate_presence_of(:currency)}

0 commit comments

Comments
 (0)