ckdake/setler — pull request #25 by iamvery (2013-06-22 03:19:30+00:00)
Title: WIP: Rails 4 compatibility

Here's a first try at setler compatibility with Rails 4. There is a pretty big snag, and I'm not sure how we'll want to approach it. This patch, as is, would be API incompatible with previous versions of setler :frowning:

The gist of the issue is with Rails 4's change to `all` it is now used as a base for other methods such as `where`. Since setler overrides `all` there is actually an infinite loop introduced when using setler with Rails 4.

The second problem is the lack of `attr_accessible` in Rails 4. This was easily addressed by conditionally calling `attr_accessible` based on the Rails' major version rather than the ability to `respond_to` the method.

What do you think? It doesn't quite feel done, but I'm not sure what the _right_ answer is.