Skip to content

Instantly share code, notes, and snippets.

@seangaffney
Created June 23, 2011 02:37
Show Gist options
  • Save seangaffney/1041775 to your computer and use it in GitHub Desktop.
Save seangaffney/1041775 to your computer and use it in GitHub Desktop.
Inexplicable validation fail
ruby-1.9.2-p180-patched :010 > s = Style.create!(:name => "Awesometown", :family => 'Yay beer', :code => '8D')
ActiveRecord::RecordInvalid: Validation failed: Name can't be blank, Family can't be blank, Code can't be blank
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/validations.rb:49:in `save!'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/transactions.rb:245:in `block in save!'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/transactions.rb:207:in `transaction'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/transactions.rb:245:in `save!'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/activerecord-3.0.9/lib/active_record/validations.rb:34:in `create!'
from (irb):10
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in `start'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in `start'
from /Users/seangaffney/.rvm/gems/ruby-1.9.2-p180-patched/gems/railties-3.0.9/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment