diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-01-17 17:00:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-17 17:00:10 -0500 |
commit | 9905cdc9465c482e193950e2f672c6c6c2e6ded1 (patch) | |
tree | c814faabc81b89e6bacb122640433a8a1d4205fe /activerecord | |
parent | b278db1d2361656c634c15c94ea981e6d0e327f9 (diff) | |
download | rails-9905cdc9465c482e193950e2f672c6c6c2e6ded1.tar.gz rails-9905cdc9465c482e193950e2f672c6c6c2e6ded1.tar.bz2 rails-9905cdc9465c482e193950e2f672c6c6c2e6ded1.zip |
Use public_send instead since respond_to? doesn't include private/protected methods by default
Co-Authored-By: dylanahsmith <dylan.smith@shopify.com>
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 842fb1c54b..a0f6ada3ff 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -93,7 +93,7 @@ module ActiveRecord if mapping.length == 1 column_name, aggr_attr = mapping.first values = Array.wrap(value).map do |object| - object.respond_to?(aggr_attr) ? object.send(aggr_attr) : object + object.respond_to?(aggr_attr) ? object.public_send(aggr_attr) : object end build(table.arel_attribute(column_name), values) else |