Displaying 1 result from an estimated 1 matches for "retailer_id".
2006 Jun 06
1
Please Help with single table inheritance relationships
...ed model from rails'' scaffolding
class Address < ActiveRecord::Base
end
# Manually added these 3 classes
class ShippingAddress < Address
belongs_to :person
end
class BillingAddress < Address
belongs_to :person
end
class ShipFromAddress < Address
belongs_to :retailer
def retailer_id= (input)
person_id = input;
end
def retailer_id
person_id
end
end
# Made these changes:
class Person < ActiveRecord::Base
has_one :shipping_address
has_one :billing_address
end
class Retailer < ActiveRecord::Base
has_one :ship_from_address
end
---
Now, this all makes some...