Skip to content

Rails 5 Deprecation Warning #37

Description

@mazikwyry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions