closure_tree
closure_tree copied to clipboard
Don't check #present? of ActiveRecord objects because it's always true
(or the variable is assigned nil and it's always false)
While the rails maintainers decide whether it's a good idea https://github.com/rails/rails/issues/35059
I found this because out of curiosity I ran our test suite with ApplicationRecord#present? raising in our projects
it may also make sense to just look at the parent id
not sure if we're going to make that lookup right afterwards anyway, but it is a thought