From 33df3ed384563b1e302e5a4f2186b156c35bafc5 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 23 May 2015 18:38:44 -0400 Subject: Add `respond_to_missing?` for Commit and Repository As of Ruby 1.9, this is the correct way to handle `respond_to?` for methods implemented by `method_missing`. See https://robots.thoughtbot.com/always-define-respond-to-missing-when-overriding --- app/models/commit.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index f02fe240540..9d721661629 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -172,10 +172,8 @@ class Commit @raw.send(m, *args, &block) end - def respond_to?(method) - return true if @raw.respond_to?(method) - - super + def respond_to_missing?(method, include_private = false) + @raw.respond_to?(method, include_private) || super end # Truncate sha to 8 characters -- cgit v1.2.1