Skip to content

Instantly share code, notes, and snippets.

@erez-rabih
Created August 28, 2012 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erez-rabih/3503573 to your computer and use it in GitHub Desktop.
Save erez-rabih/3503573 to your computer and use it in GitHub Desktop.
module AccountOfUser
def <<(account)
account.kind = "UserAccount"
proxy_association.owner.accounts += [account]
end
end
class User < ActiveRecord::Base
attr_accessible :name
has_many :accounts, :extend => AccountOfUser
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment