rails/rails — pull request #14134 by ehutzelman (2014-02-21 02:12:52+00:00)
Title: Some Validation::HelperMethods no longer callable on model instance in 4.1.rc1

`validates_acceptance_of` helper method no longer working when called on model instance due to validator setup method being called from initializer. Failing test case attached.

After some digging, the code in commit https://github.com/rails/rails/commit/7d84c3a2f7ede0e8d04540e9c0640de7378e9b3a now calls the validator setup for both class level and instance level validates_with methods. Previously, the setup method was only called when using class level validators as described in these comments for `ActiveModel::Validator`:

# This setup method is only called when used with validation macros or the
# class level validates_with method.

In the example of `validates_acceptance_of`, the setup method relies on a class method `attribute_method?` which fails when called in the context of the instance level validator.

sorry @apotonick, I made the previous pull request against the wrong branch and had to close and open new issue. Let me know if this makes sense or if I'm missing something.