Agile Web Development

Build it. Launch it. Love it.

has_remote

Connect your local model to a remote resource using ActiveResource, to make it look for certain attributes remotely. Caching and syncing is built in.

 class User < ActiveRecord::Base
   has_remote :site => "http://profiles-app.com" do |r|
     r.attribute :email
   end
 end

 User.remote_class #=> User::Remote (ActiveResource)
 User.first.remote #=> #<User::Remote:...>
 User.first.email #=> "email@fromremote.com"

Vitals

Home http://github.com/innovationfactory/has_remote
Repository git://github.com/innovationfactory/has_remote.git
License Rails' (MIT)
Rating (2 votes)
Owner Innovation Factory
Created 8 April 2009

Comments

Add a comment