Skip to content
Browse files

Use `all?`.

  • Loading branch information...
1 parent dc5daca commit 7f208e71c801a67d9b331df59720101d456c3662 @gabebw gabebw committed Sep 28, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb
View
4 lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb
@@ -97,9 +97,7 @@ def matches?(subject)
def allows_blank_value?
if @options.key?(:allow_blank)
blank_values = ['', ' ', "\n", "\r", "\t", "\f"]
- @options[:allow_blank] == blank_values.inject(true) do |memo, value|
- memo &&= allows_value_of(value)
- end
+ @options[:allow_blank] == blank_values.all? { |value| allows_value_of(value) }
else
true
end

0 comments on commit 7f208e7

Please sign in to comment.
Something went wrong with that request. Please try again.