Acts As Proxy plugin

Plugin details

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.

Websitehttp://code.google.com/p/actsasproxy/ Repositoryhttp://actsasproxy.googlecode.com/svn/trunk/ Author Lance Ivy Tags ActiveRecord LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://actsasproxy.googlecode.com/svn/trunk/

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

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: Guest, 7 months ago