Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-24 01:38:44 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-06-10 08:31:27 +0300
commit33df3ed384563b1e302e5a4f2186b156c35bafc5 (patch)
tree275dcc47727c3958aec3cc8a7f4d1849031e7601 /app/models/repository.rb
parent57830201a9152b56ccf65a98275601617f44653d (diff)
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
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 1ca97017637..2c6347222aa 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -163,10 +163,8 @@ class Repository
end
end
- def respond_to?(method)
- return true if raw_repository.respond_to?(method)
-
- super
+ def respond_to_missing?(method, include_private = false)
+ raw_repository.respond_to?(method, include_private) || super
end
def blob_at(sha, path)