We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd13662 commit 0298cc4Copy full SHA for 0298cc4
app/models/plan.rb
@@ -5,8 +5,7 @@
5
# rename currency to price_currency
6
7
class Plan < ActiveRecord::Base
8
- #FIXME: this is not working , the subscription model is a mailer
9
- # has_many :subscriptions
+ has_many :subscriptions , class_name: 'Teams::AccountPlan'
10
11
after_create :register_on_stripe
12
after_destroy :unregister_from_stripe
spec/models/plan_spec.rb
@@ -1,6 +1,7 @@
1
require 'spec_helper'
2
3
RSpec.describe Plan, :type => :model do
4
+ it {is_expected.to have_many(:subscriptions)}
it {is_expected.to validate_presence_of(:amount)}
it {is_expected.to validate_presence_of(:name)}
it {is_expected.to validate_presence_of(:currency)}
0 commit comments