Displaying 1 result from an estimated 1 matches for "current_payment_method".
2008 Jul 16
2
belongs_to causing endless loop on first call to save!
...g already-existing rows.
In the model tier, I have the following classes defined:
class PrimaryAccount < Account
has_many :payment_methods, :foreign_key => "account_id" #using single
table inheritance, which is why foreign key is not "primary_account_id"
belongs_to :current_payment_method, :class_name => "PaymentMethod",
:foreign_key => "current_payment_method_id" #points to same table, so I can
have many payment_methods, but also mark as being the current one to bill
...
class PaymentMethod < ActiveRecord::Base
belongs_to :account #normal bidirectio...