Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify the condions lambda generation

  • Loading branch information...
commit d10cadca0cda894ce4536a3b9d9367bc6f5d9b0e 1 parent d433436
@tenderlove tenderlove authored
Showing with 2 additions and 12 deletions.
  1. +2 −12 activesupport/lib/active_support/callbacks.rb
View
14 activesupport/lib/active_support/callbacks.rb
@@ -463,18 +463,8 @@ def compute_identifier(filter)
end
def conditions_lambdas
- conditions = []
-
- unless options[:if].empty?
- lambdas = Array(options[:if]).map { |c| make_lambda c }
- conditions.concat lambdas
- end
-
- unless options[:unless].empty?
- lambdas = Array(options[:unless]).map { |c| make_lambda c }
- conditions.concat lambdas.map { |l| invert_lambda l }
- end
- conditions
+ Array(options[:if]).map { |c| make_lambda c } +
+ Array(options[:unless]).map { |c| invert_lambda make_lambda c }
end
def _normalize_legacy_filter(kind, filter)
Please sign in to comment.
Something went wrong with that request. Please try again.