My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Sometimes it's handy for one of your ActiveRecord classes to proxy methods from another associated class. This can be useful for simplifying forms, for example.

Once you've installed the ActsAsProxy plugin you can do something like the following:

class User < ActiveRecord::Base
  has_one :address
  proxies :address, :city, :state, :zip
end

u = User.new
u.address_city = 'Schenectady'
u.address_state = 'New York'
u.address_zip = 12345

u.address_city == u.address.city
Powered by Google Project Hosting