Closed iamvery closed 11 years ago
Nice! Changing the API is :cry: but if it has to be done it can be done. Maybe there is a way to do some terrible code duplication that works but shows a deprecation notice in <4 and does the new api in 4+?
It'd be great for you to talk to @alindeman about this too.
I like the sound of that! I'll see if I can put something together.
I tried using ActiveSupport::Deprecation instead of Kernel#warn, but it wasn't working for some reason. Not sure about best practice here.
Any other changes needed for Rails 4 or is this it? I'm :thumbsup: for merging if it's enough!
All the tests (that were passing with Rails 3, see below) are passing with Rails 4 here. There are a number of deprecation warnings that should probably be addressed, but it is confirmed working with Rails 4.
Note: The last test has always failed for me despite Rails version.
v0.0.12 released!
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 aswhere
. Since setler overridesall
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 callingattr_accessible
based on the Rails' major version rather than the ability torespond_to
the method.What do you think? It doesn't quite feel done, but I'm not sure what the right answer is.