Skip to content

Instantly share code, notes, and snippets.

@ananyo2012
Created January 3, 2017 04:04
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 ananyo2012/811d8e6a650b4be83ab0c0b3a72b2076 to your computer and use it in GitHub Desktop.
Save ananyo2012/811d8e6a650b4be83ab0c0b3a72b2076 to your computer and use it in GitHub Desktop.
Node Shared Concern
module NodeShared
extend ActiveSupport::Concern
def likes
self.cached_likes
end
def liked_by(uid)
self.likers.collect(&:uid).include?(uid)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment