Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #9945 from vipulnsward/drop_var_in_validations

Drop variable assignment in validations
  • Loading branch information...
commit 81b7ebf7056e23d2614d3071402536d9184ddeed 2 parents c56e620 + c082e3f
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  activerecord/lib/active_record/validations.rb
View
3  activerecord/lib/active_record/validations.rb
@@ -74,8 +74,7 @@ def valid?(context = nil)
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
Please sign in to comment.
Something went wrong with that request. Please try again.