Skip to content

Commit baf5e6e

Browse files
committed
Update try to work with rails 4.0
1 parent 747282d commit baf5e6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/grape-swagger.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ class Object
192192
# @person.try(:name)
193193
#
194194
# File activesupport/lib/active_support/core_ext/object/try.rb#L32
195-
def try(*a, &b)
195+
def try(*a, &b)
196196
if a.empty? && block_given?
197197
yield self
198198
else
199-
__send__(*a, &b)
199+
public_send(*a, &b) if respond_to?(a.first)
200200
end
201201
end
202202
end

0 commit comments

Comments
 (0)