app/models/stripe_local/customer.rb in stripe_local-0.0.2 vs app/models/stripe_local/customer.rb in stripe_local-0.1.0
- old
+ new
@@ -2,21 +2,23 @@
class Customer < ActiveRecord::Base
include ObjectAdapter
self.primary_key = :id
- has_one :model, inverse_of: :customer, class_name: "::#{StripeLocal::model_class}"
+ belongs_to :model, inverse_of: :customer, class_name: "::#{StripeLocal::model_class}"
has_many :cards, inverse_of: :customer
has_many :invoices, inverse_of: :customer
has_many :charges, inverse_of: :customer
has_one :subscription, inverse_of: :customer
- has_one :plan, through: :subscription, source: :plan
+ has_one :plan, through: :subscription,
+ inverse_of: :members,
+ source: :plan
class<<self
#=!=#>>>
#
# this is the primary interface for subscribing.
@@ -89,9 +91,10 @@
# t.string :default_card
# t.boolean :delinquent
# t.string :description
# t.string :email
# t.text :metadata
+# t.integer :model_id
# t.timestamps
#=ยก=>>>
end
end