diff options
author | John Firebaugh <john_firebaugh@us.ibm.com> | 2011-02-21 16:30:33 -0800 |
---|---|---|
committer | John Firebaugh <john_firebaugh@us.ibm.com> | 2011-07-17 11:34:06 -0700 |
commit | cbf924ef0854c26d0d0340d0b09a26782e0c661d (patch) | |
tree | ef4d1bcf26735ffad470436b03e0c81db7debe1a /activemodel/lib/active_model | |
parent | 2a9a10f5e3d4d8fc607606e700d1fd2dfec4eda2 (diff) | |
download | rails-cbf924ef0854c26d0d0340d0b09a26782e0c661d.tar.gz rails-cbf924ef0854c26d0d0340d0b09a26782e0c661d.tar.bz2 rails-cbf924ef0854c26d0d0340d0b09a26782e0c661d.zip |
Replace map+compact with select
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/serialization.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index 78516608fd..0b4067257e 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -76,7 +76,7 @@ module ActiveModel attribute_names -= Array.wrap(except).map(&:to_s) end - method_names = Array.wrap(options[:methods]).map { |n| n if respond_to?(n.to_s) }.compact + method_names = Array.wrap(options[:methods]).select { |n| respond_to?(n) } Hash[(attribute_names + method_names).map { |n| [n, send(n)] }] end end |