diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-08-28 08:53:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-28 08:53:35 +0200 |
commit | 7a65dc6fe3c54058d92058c14021d017bd279fc6 (patch) | |
tree | bdc4f2f49fe4dd06cace02473815728db1cf318a /activerecord/lib/active_record/core.rb | |
parent | cec60d39891650c96f008aadcb49c249626da3f5 (diff) | |
parent | 73b8823a9373c2631c2cf310d036e846c37204d0 (diff) | |
download | rails-7a65dc6fe3c54058d92058c14021d017bd279fc6.tar.gz rails-7a65dc6fe3c54058d92058c14021d017bd279fc6.tar.bz2 rails-7a65dc6fe3c54058d92058c14021d017bd279fc6.zip |
Merge pull request #26306 from kamipo/remove_under_ruby-1.9
Remove "Under Ruby 1.9" [ci skip]
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index cb11cdefd9..aef4761be4 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -541,15 +541,15 @@ module ActiveRecord private - # Under Ruby 1.9, Array#flatten will call #to_ary (recursively) on each of the elements - # of the array, and then rescues from the possible NoMethodError. If those elements are - # ActiveRecord::Base's, then this triggers the various method_missing's that we have, - # which significantly impacts upon performance. - # - # So we can avoid the method_missing hit by explicitly defining #to_ary as nil here. - # - # See also http://tenderlovemaking.com/2011/06/28/til-its-ok-to-return-nil-from-to_ary.html - def to_ary # :nodoc: + # +Array#flatten+ will call +#to_ary+ (recursively) on each of the elements of + # the array, and then rescues from the possible +NoMethodError+. If those elements are + # +ActiveRecord::Base+'s, then this triggers the various +method_missing+'s that we have, + # which significantly impacts upon performance. + # + # So we can avoid the +method_missing+ hit by explicitly defining +#to_ary+ as +nil+ here. + # + # See also http://tenderlovemaking.com/2011/06/28/til-its-ok-to-return-nil-from-to_ary.html + def to_ary nil end |