ErwinM / acts_as_tenant

Easy multi-tenancy for Rails in a shared database setup.
MIT License
1.56k stars 264 forks source link

Update logic to incorporate changes in ActiveModel::Dirty in Rails 5.2 #273

Closed murugan-r closed 2 years ago

murugan-r commented 2 years ago

In Rails 5, Activemode::Dirty behaviour has changed for _changed?, _was in before callbacks. For reference: https://github.com/rails/rails/pull/25337

excid3 commented 2 years ago

I just ran your test against the codebase without your code changes and it passes, so it looks like we're already fine with Rails 5.2+.

Did you have a test that failed against the current implementation?

murugan-r commented 2 years ago

I just ran your test against the codebase without your code changes and it passes, so it looks like we're already fine with Rails 5.2+.

Did you have a test that failed against the current implementation?

@excid3 I do not have a test which fail against the current implementation due to both methods behave similarly in this situation. These new method are more intuitive and brings more clarity while reading code.

excid3 commented 2 years ago

Okay, I thought your PR description was saying that it wasn't working properly with Rails 5.2.