Skip to content

Instantly share code, notes, and snippets.

@kfatehi
Created July 3, 2012 03:49
Show Gist options
  • Save kfatehi/3037529 to your computer and use it in GitHub Desktop.
Save kfatehi/3037529 to your computer and use it in GitHub Desktop.
class PolymorphicThing
# I am trying to prevent duplicate records as such.
validates :user_id, :uniqueness => {:scope => [:verb, :resource_type, :resource_id]}
end
# It works but there must be a better way to prevent dupes?
# The fields referenced are the only columns on this table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment