Skip to content

Instantly share code, notes, and snippets.

@iain
Created August 28, 2008 20:54
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 iain/7820 to your computer and use it in GitHub Desktop.
Save iain/7820 to your computer and use it in GitHub Desktop.
humans do:
errors.add(:topic, :custom_invalid)
rails does:
errors.add(:topic, :invalid, :default => :custom_invalid)
extra fallback?
class Content < ActiveRecord::Base
validate :mine
def mine
errors.add(:topic, :custom_invalid, :default => "customly invalid")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment