Skip to content

Instantly share code, notes, and snippets.

@ohadlevy
Created October 16, 2012 10:39
Show Gist options
  • Save ohadlevy/3898599 to your computer and use it in GitHub Desktop.
Save ohadlevy/3898599 to your computer and use it in GitHub Desktop.
diff --git a/app/models/lookup_key.rb b/app/models/lookup_key.rb
index 256f07d..5c45396 100644
--- a/app/models/lookup_key.rb
+++ b/app/models/lookup_key.rb
@@ -150,8 +150,8 @@ class LookupKey < ActiveRecord::Base
begin
self.default_value = cast_validate_value self.default_value
true
- rescue
- errors.add(:default_value, "is invalid")
+ rescue => e
+ errors.add(:default_value, "#{default_value}.inspect is invalid for #{to_s}: #{e}")
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment