search for: has_shipping_address

Displaying 1 result from an estimated 1 matches for "has_shipping_address".

2009 Jun 24
1
accepts_nested_attributes_for :reject_if issue
I have the following models: class Order < ActiveRecord::Base belongs_to :billing_address belongs_to :shipping_address accepts_nested_attributes_for :billing_address accepts_nested_attributes_for :shipping_address, :reject_if => proc { |attributes| attributes[''has_shipping_address''] != ''1'' } def after_initialize self.build_billing_address unless billing_address self.build_shipping_address unless shipping_address end end class ShippingAddress < OrderAddress attr_accessor :has_shipping_address end class OrderAddress < ActiveRe...