Having trouble fixing assert_invalid_column_on_record deprecations?
Posted by admin, Thu Jan 25 09:38:48 UTC 2007
The current deprecation warning is:DEPRECATION WARNING: assert_invalid_column_on_record is deprecated and will be removed from Rails 2.0 (use assert(record.errors.invalid?(column)) instead)
But it would be much easier to fix this warning if the docs said something like:
DEPRECATION WARNING: assert_invalid_column_on_record is deprecated and will be removed from Rails 2.0 (use assert(find_record_in_template(key).errors.invalid?(column)) instead)
So you change your bad/old code that looks like this:
<br />assert_invalid_column_on_record "user", :password<br />
To something like this:
<br />assert(find_record_in_template("user").errors.invalid?(:password))<br />