You cannot use ActiveRecord relationships.
You can still bind two objects using instance methods, for example:
class User < ActiveRecord::Base def avatar Avatar.where(:user_id => self.id).first end def avatar=(avatar) avatar.update_attributes(:user_id => self.id) end end
It would be interesting to encapsulate this in a module:) ...
source share