There was an error while loading. Please reload this page.
2 parents d22208a + ce6eca2 commit 24e38b1Copy full SHA for 24e38b1
.travis.yml
@@ -5,6 +5,7 @@ rvm:
5
- 2.0.0
6
- 2.1
7
- 2.2
8
+ - 2.3.0
9
- jruby
10
11
sudo: false
lib/zendesk_api/collection.rb
@@ -282,17 +282,19 @@ def clear_cache
282
end
283
284
# @private
285
- def to_ary; nil; end
+ def to_ary
286
+ nil
287
+ end
288
- def respond_to?(name)
- super || Array.new.respond_to?(name)
289
+ def respond_to_missing?(name, include_all)
290
+ [].respond_to?(name, include_all)
291
292
293
# Sends methods to underlying array of resources.
294
def method_missing(name, *args, &block)
295
if resource_methods.include?(name)
296
collection_method(name, *args, &block)
- elsif Array.new.respond_to?(name)
297
+ elsif [].respond_to?(name, false)
298
array_method(name, *args, &block)
299
else
300
next_collection(name, *args, &block)
@@ -452,7 +454,7 @@ def with_association?
452
454
## Method missing
453
455
456
def array_method(name, *args, &block)
- to_a.send(name, *args, &block)
457
+ to_a.public_send(name, *args, &block)
458
459
460
def next_collection(name, *args, &block)
0 commit comments