diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2010-05-08 23:29:20 +0300 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-05-08 23:51:36 +0300 |
commit | e17ff6d617abe3fa36c053eaed52e134074035a1 (patch) | |
tree | 47a84df59c7985b82393fd008d1536602d481efa /activerecord/lib/active_record | |
parent | 66913a76af9969ddf12021992eeb418e270bebe2 (diff) | |
download | rails-e17ff6d617abe3fa36c053eaed52e134074035a1.tar.gz rails-e17ff6d617abe3fa36c053eaed52e134074035a1.tar.bz2 rails-e17ff6d617abe3fa36c053eaed52e134074035a1.zip |
updated AR to work with the AMo model validation changes
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/validations.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 8b266be638..b2ee51fa51 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -74,7 +74,7 @@ module ActiveRecord def valid? errors.clear - @_on_validate = new_record? ? :create : :update + self.validation_context = new_record? ? :create : :update _run_validate_callbacks deprecated_callback_method(:validate) @@ -87,6 +87,10 @@ module ActiveRecord errors.empty? end + + def invalid? + !valid? + end end end end |