ClosureTree/closure_tree

Still getting deprecation warnings on Rails 5.1

malacalypse opened this issue · 9 comments

Running Rails 5.1, closure_tree 6.5.0

Not sure why, but I'm still getting deprecation warnings such as:

DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block (2 levels) in <class:CommentsControllerTest> at /Users/user/Development/app/test/controllers/some_controller_test.rb:6)

These come when creating a model with has_closure_tree. When I comment out that line in the model, the deprecation warnings cease. I get a warning for each of the following methods:

attribute_changed
attribute_changed?
changed
changes

There seems to be, at least on the master branch, already a workaround for changes in place but it doesn't seem to be triggering (yes my version of ActiveSupport is 5.1.0, I checked).

Ah, my mistake. It looks like that wasn't in 6.5.0. Any ETA on when a new version will be cut, at least to fix this issue?

Thanks!

If you have time to take a look at those failures and post a PR, fame and fortune will be yours for the taking. I won't be able to get to that today.

And by "fame and fortune", I mean "a thank you for your time and effort will be added to the changelog."

My recommendation (I don't have the time to make a PR right now, but I'll see what I can do) is to use t.references instead of t.integer for those foreign key columns. That should use the right integer type for the DB.

I believe this is fixed on #262 but there hasn't been a new release after it being merged. I'm not getting the deprecation warning when using the git repo.
Is there any plan for a new version?

release was cut and published last week.

I'm still getting these, running on Rails 5.1.4, gem version is 6.6.0.