Skip to content

Instantly share code, notes, and snippets.

@vaxinate
Last active December 15, 2015 12:09
Show Gist options
  • Save vaxinate/5258737 to your computer and use it in GitHub Desktop.
Save vaxinate/5258737 to your computer and use it in GitHub Desktop.
def current_user_is_content_owner?(model)
return unless model.respond_to?(:user)
current_user && model.user.id == current_user.id
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment