Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Customer < ActiveRecord::Base
- def initialize
- @address = Address.new(self)
- end
- end
- class Address
- def initialize(customer)
- @customer = customer
- # ...other initialization
- end
- attr_reader :customer
- delegate :zip, :zip=, :street, :street=, :to => :customer
- end
Advertisement
Add Comment
Please, Sign In to add comment