acts_as_ordered_tree
acts_as_ordered_tree copied to clipboard
Rails 5 Deprecation Warning
Hey! Great gem! In Rails 5 I can see a deprecation warning like this:
DEPRECATION WARNING: You are passing an instance of ActiveRecord::Base to `find`. Please pass the id of the object by calling `.id`.
everytime I create new tree node:
tree_item.children.create(itemable: itemable)
Maybe it is only because TreeItem that uses acts_as_ordered_tree is polymorphic.
class TreeItem < ApplicationRecord
acts_as_ordered_tree
belongs_to :project
belongs_to :itemable,
polymorphic: true,
inverse_of: :tree_item
end