mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Use all?
.
This commit is contained in:
parent
dc5daca58f
commit
7f208e71c8
1 changed files with 1 additions and 3 deletions
|
@ -97,9 +97,7 @@ module Shoulda # :nodoc:
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue