Ruby Validation failed on .create -


i attempting use .create method getting error:

validation failed: account can't blank

this code running produce error:

what cause .create! produce error when apparent :account not blank?

edit:

here more info around validations:

*it's worth noting sample code in initial post not complete script, simple code experiencing error with. define several other attributes inside script didn't want put noise in post.

your problem validates_presence_of on account_id passing in account. error message says account because when humanizing field name, drops id.

you may want try create with:

test.newentry.create!({               :account_id => demo_account.id,               :date => date }) 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -