diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2010-09-05 21:23:41 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-06 13:40:06 +0200 |
commit | ed2650646ec9bd1103d6c049db8df99b7313d6b1 (patch) | |
tree | fe58201039708c595f3d5c9c91825af53dcb4606 | |
parent | 9b610049bb4f73dbcdc670879683ec2a1a2ab780 (diff) | |
download | rails-ed2650646ec9bd1103d6c049db8df99b7313d6b1.tar.gz rails-ed2650646ec9bd1103d6c049db8df99b7313d6b1.tar.bz2 rails-ed2650646ec9bd1103d6c049db8df99b7313d6b1.zip |
Refactor AR validations a bit
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | activerecord/lib/active_record/validations.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index e4c366ea63..f367315b22 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -60,11 +60,7 @@ module ActiveRecord def perform_validations(options={}) perform_validation = options[:validate] != false - if perform_validation - valid?(options.is_a?(Hash) ? options[:context] : nil) - else - true - end + perform_validation ? valid?(options[:context]) : true end end end |