aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman@gmail.com>2015-07-30 13:00:15 -0500
committerRichard Schneeman <richard.schneeman@gmail.com>2015-07-30 13:00:15 -0500
commit5373bf228d1273deae0ed03370ec4a63c580422b (patch)
treee599b78b39c66d83fb05fae03290ecd6927e91a0 /activerecord
parent70009e31005220ddacce0a27a2908858be268a0a (diff)
parent22f592401444a83b7b2d3c2165ac666d69955d08 (diff)
downloadrails-5373bf228d1273deae0ed03370ec4a63c580422b.tar.gz
rails-5373bf228d1273deae0ed03370ec4a63c580422b.tar.bz2
rails-5373bf228d1273deae0ed03370ec4a63c580422b.zip
Merge pull request #21057 from schneems/schneems/journey-formatter-objects
Beyond Ludicrous Speed
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index abe1d465a5..7fb899c242 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -230,7 +230,15 @@ module ActiveRecord
# person.respond_to(:nothing) # => false
def respond_to?(name, include_private = false)
return false unless super
- name = name.to_s
+
+ case name
+ when :to_partial_path
+ name = "to_partial_path".freeze
+ when :to_model
+ name = "to_model".freeze
+ else
+ name = name.to_s
+ end
# If the result is true then check for the select case.
# For queries selecting a subset of columns, return false for unselected columns.