Column name 'parent' replaces automatically to 'parent_id'
green-ghost opened this issue · comments
green-ghost commented
Schema:
create_table "products", force: :cascade do |t|
t.string "title"
t.text "description"
t.integer "parent" #Foreign key
t.boolean "leaf"
end
code:
Product.join_recursive { start_with(parent: nil).connect_by(id: :parent).order_siblings(:title) }
Error:
PG::UndefinedColumn: ERROR: column products.parent_id does not exist
Alexey Mikhaylov commented
hi @green-ghost
Could you also show me your Product
model definition and erroneous SQL query?
Zach Aysan commented
I'm closing this issue due to lack of followup.