class Order < ActiveRecord::Base def self.new_with_defaults(attributes = {}) returning(new(attributes)) do |order| order.credit_card = "9999 9999 9999 9999" order.expiration_date = "12/03" end end def account=(account) self.bill_to_first_name = account.first_name self.bill_to_last_name = account.last_name self.billing_address_line_1 = account.address_line_1 self.billing_address_line_2 = account.address_line_2 self.billing_city = account.city self.billing_state = account.state self.billing_zip = account.zip self.billing_country = account.country end end