Skip to content
This repository
Browse code

Use `all?`.

  • Loading branch information...
commit 7f208e71c801a67d9b331df59720101d456c3662 1 parent dc5daca
Gabe Berke-Williams authored September 28, 2012
4  lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb
@@ -97,9 +97,7 @@ def matches?(subject)
97 97
         def allows_blank_value?
98 98
           if @options.key?(:allow_blank)
99 99
             blank_values = ['', ' ', "\n", "\r", "\t", "\f"]
100  
-            @options[:allow_blank] == blank_values.inject(true) do |memo, value|
101  
-              memo &&= allows_value_of(value)
102  
-            end
  100
+            @options[:allow_blank] == blank_values.all? { |value| allows_value_of(value) }
103 101
           else
104 102
             true
105 103
           end

0 notes on commit 7f208e7

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