Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Still getting deprecation warnings on Rails 5.1 #269

Closed
malacalypse opened this issue May 3, 2017 · 9 comments
Closed

Still getting deprecation warnings on Rails 5.1 #269

malacalypse opened this issue May 3, 2017 · 9 comments

Comments

@malacalypse
Copy link

malacalypse commented May 3, 2017

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).

@malacalypse
Copy link
Author

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?

@mceachen
Copy link
Collaborator

mceachen commented May 4, 2017 via email

@mceachen
Copy link
Collaborator

mceachen commented May 4, 2017

@malacalypse
Copy link
Author

Thanks!

@mceachen
Copy link
Collaborator

mceachen commented May 4, 2017

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."

@malacalypse
Copy link
Author

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.

@arashm
Copy link

arashm commented May 29, 2017

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?

@mceachen
Copy link
Collaborator

release was cut and published last week.

@nikolalsvk
Copy link

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants