From 3ea70f985b1799c27b907724920e5615018e505d Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sat, 5 May 2012 02:24:57 -0400 Subject: Use respond_to_missing? for OrderedOptions --- activesupport/lib/active_support/ordered_options.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index 538e41e0eb..60e6cd55ad 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -36,7 +36,7 @@ module ActiveSupport #:nodoc: end end - def respond_to?(name) + def respond_to_missing?(name, include_private) true end end -- cgit v1.2.3 From 9bda37474e2cd3db63102f6b63246ebc54011ad2 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sat, 5 May 2012 02:34:18 -0400 Subject: Use respond_to_missing? for Chars --- activesupport/lib/active_support/multibyte/chars.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 9a748dfa60..b20c980f36 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -62,8 +62,8 @@ module ActiveSupport #:nodoc: # Returns +true+ if _obj_ responds to the given method. Private methods are included in the search # only if the optional second parameter evaluates to +true+. - def respond_to?(method, include_private=false) - super || @wrapped_string.respond_to?(method, include_private) + def respond_to_missing?(method, include_private) + @wrapped_string.respond_to?(method, include_private) end # Returns +true+ when the proxy class can handle the string. Returns +false+ otherwise. -- cgit v1.2.3 From 14762dc5effbc7bb9ae94cb5af895a9a33512867 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sat, 5 May 2012 02:42:48 -0400 Subject: Use respond_to_missing for TimeWithZone --- activesupport/lib/active_support/time_with_zone.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 1cb71012ef..120b2a4c28 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -311,10 +311,10 @@ module ActiveSupport end # Ensure proxy class responds to all methods that underlying time instance responds to. - def respond_to?(sym, include_priv = false) + def respond_to_missing?(sym, include_priv) # consistently respond false to acts_like?(:date), regardless of whether #time is a Time or DateTime - return false if sym.to_s == 'acts_like_date?' - super || time.respond_to?(sym, include_priv) + return false if sym.to_sym == :acts_like_date? + time.respond_to?(sym, include_priv) end # Send the missing method to +time+ instance, and wrap result in a new TimeWithZone with the existing +time_zone+. -- cgit v1.2.3