jnunemaker/mongomapper — pull request #474 by cheald (2012-11-03 02:44:21+00:00)
Title: Fix Ruby 2.0 breakage caused by behavior changes to #respond_to? - fixes #473

Ruby 2.0 introduces a change in the behavior of `#respond_to?`. See http://tenderlovemaking.com/2012/09/07/protected-methods-and-ruby-2-0.html for the full details.

This patch simply fixes two areas when `respond_to?` is being used against protected methods. The first, in proxy.rb, simply passes `true` as a second parameter to `respond_to?`, which tells it to look at private/protected methods in addition to public methods. The second fix in dirty.rb simply promoted the required method to public visibility.

I tested these changes on MRI 1.8.7, MRI 1.9.3, and MRI 2.0.0-preview1.