jcasimir/draper — pull request #189 by cheald (2012-05-11 00:54:58+00:00)
Title: Fix accidental clobbering of special ActiveModel methods

#183 introduced `Draper::ActiveModelSupport::Proxies` which defines proxy methods for certain methods that have special meaning in the context of Rails. Unfortunately, it also caused methods that were defined on a decorator to be clobbered, preventing for example, decorators from implementing `#to_param`.

This patch checks for the existence of these methods on the object before redefining them, and checks that the defined method was defined on the decorator, and not higher up the object hierarchy (like ActiveSupport's `Object#to_param` for instance).

Includes tests.