Skip to content

Instantly share code, notes, and snippets.

@kagemusha
Created May 24, 2012 13:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kagemusha/2781562 to your computer and use it in GitHub Desktop.
Save kagemusha/2781562 to your computer and use it in GitHub Desktop.
TypeError: Cannot visit...(Rails)
Version: Rails 3.2.1
TypeError: Cannot visit Videoset
Happens when specify class for id in validations (perhaps other places), e.g.:
INCORRECT
validates_uniqueness_of :song_num, :scope=>[:videoset]
CORRECT
validates_uniqueness_of :song_num, :scope=>[:videoset_id]
Would be nice if rails smart enough to take both
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment