Skip to content

Instantly share code, notes, and snippets.

@cbmeeks
Created February 9, 2011 01:26
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 cbmeeks/817698 to your computer and use it in GitHub Desktop.
Save cbmeeks/817698 to your computer and use it in GitHub Desktop.
def likes_the(obj)
like = Like.find_or_initialize_by_likeable_type_and_likeable_id_and_user_id(obj.class.name, obj.id, self.id)
like.amount = 1
like.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment