acts_as_ordered_tree icon indicating copy to clipboard operation
acts_as_ordered_tree copied to clipboard

Rails 5 Deprecation Warning

Open mazikwyry opened this issue 8 years ago • 0 comments

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

mazikwyry avatar Jun 26 '17 13:06 mazikwyry