aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-02-07 19:15:06 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-07 19:15:06 -0200
commit933adce8f45b41a5a6b6bb31ba9d6fb5188f4a35 (patch)
treeb47860e71384df3b36d20aad67e38ba9fa41b59f /activemodel
parent0de661d6c74172a9fedcced6a4e99d007df953ef (diff)
downloadrails-933adce8f45b41a5a6b6bb31ba9d6fb5188f4a35.tar.gz
rails-933adce8f45b41a5a6b6bb31ba9d6fb5188f4a35.tar.bz2
rails-933adce8f45b41a5a6b6bb31ba9d6fb5188f4a35.zip
Use map + flatten here
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/validations.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index a0f90452b3..efd071fedc 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -147,9 +147,9 @@ module ActiveModel
# List all validators that being used to validate a specific attribute.
def validators_on(*attributes)
- attributes.inject([]) do |all, attribute|
- all |= _validators[attribute.to_sym] || []
- end
+ attributes.map do |attribute|
+ _validators[attribute.to_sym]
+ end.flatten
end
# Check if method is an attribute method or not.