I need to use the parent_id column to work with jqxTree from jqWidgets (js library for ui).
Using ancestry, when I try to get the value of that column through ActiveRecord it returns null.
Let's say: Categories.select("id, parent_id")
parent_id will be null for all results
How could I manage to do it ?
parent_id is not a database column (or at least it shouldn't be). In ancestry parent_id is a method, so you cannot do a select on the column.
The values are stored in the 'ancestry' column.