Hyperactive Resource plugin

Plugin details

HyperActiveResource extends ActiveResource so it works properly and behaves more like ActiveRecord

Websitehttp://github.com/lukegalea/hyperactiveresource/wikis Repositorygit://github.com/lukegalea/hyperactiveresource.git Author Medical Decision Logic Tags resource LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/lukegalea/hyperactiveresource.git

Example
==========

1. Install the plugin via:

cd path/to/rails_root/vendor/plugins
git clone git://github.com/lukegalea/hyperactiveresource.git



2. Create a HyperactiveResource where you would normally use ActiveResource and define the meta-data/associations that drive the dynamic magic:

class Address < HyperactiveResource      
  self.columns = [ :street_address, :city, :zipcode, :home_phone_number ]
  self.belong_tos = [ :country, :state ]
  self.has_manys = [ :people ]
end



3. Enjoy the magic

address = Address.new
  address.country # nil instead of method_missing
  address.country_id = 5
  address.country #Returns Country.find(5)
etc..

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 5 months ago