cfabianski / ltree_hierarchy

Organize ActiveRecord models into a tree using PostgreSQL's ltree datatype
MIT License
141 stars 25 forks source link

Rails 5 Parent is required #22

Closed marcgreenstock closed 7 years ago

marcgreenstock commented 7 years ago

Validations fail if parent is nil.

the belongs_to association here is required unless the active_record.belongs_to_required_by_default is false or optional is set to true:

belongs_to :parent, class_name: name, foreign_key: ltree_parent_fragment_column, optional: true
marcgreenstock commented 7 years ago

Sorry duplicate of https://github.com/cfabianski/ltree_hierarchy/pull/20 closing