Get parent_id value #108

Closed
cocozz opened this Issue Oct 25, 2012 · 1 comment

Projects

None yet

2 participants

@cocozz

Hi !

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 ?

@vanderhoorn

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment