aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-27 05:56:27 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-27 05:56:27 -0700
commit81b7ebf7056e23d2614d3071402536d9184ddeed (patch)
tree755694992f4251c0aa7fd7090a1804b3da0618c1
parentc56e6204dbc622f40745e6e5f22172b435e3b962 (diff)
parentc082e3f615a078364172f0a6d8a335d6bf353d94 (diff)
downloadrails-81b7ebf7056e23d2614d3071402536d9184ddeed.tar.gz
rails-81b7ebf7056e23d2614d3071402536d9184ddeed.tar.bz2
rails-81b7ebf7056e23d2614d3071402536d9184ddeed.zip
Merge pull request #9945 from vipulnsward/drop_var_in_validations
Drop variable assignment in validations
-rw-r--r--activerecord/lib/active_record/validations.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index 3706885881..26dca415ff 100644
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -74,8 +74,7 @@ module ActiveRecord
protected
def perform_validations(options={}) # :nodoc:
- perform_validation = options[:validate] != false
- perform_validation ? valid?(options[:context]) : true
+ options[:validate] == false || valid?(options[:context])
end
end
end