Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing when requesting siblings #8

Merged
merged 1 commit into from
Jun 11, 2012
Merged

Conversation

eljojo
Copy link
Contributor

@eljojo eljojo commented Jun 4, 2012

Hi,
closure_tree was crashing when requesting siblings for a specific row.

1.9.3-p125 :006 > creativity = Tag.find 10
Tag Load (0.4ms) SELECT tags.* FROM tags WHERE tags.id = 10 ORDER BY tags.title ASC LIMIT 1
=> #<Tag id: 10, title: "creativity", description: "", created_at: "2012-04-17 11:59:18", updated_at: "2012-06-04 16:25:01", parent_id: 26, slug: "creativity">
1.9.3-p125 :008 > creativity.parent
Tag Load (0.4ms) SELECT tags.* FROM tags WHERE tags.id = 26 ORDER BY tags.title ASC LIMIT 1
=> #<Tag id: 26, title: "art", description: "", created_at: "2012-04-17 11:59:18", updated_at: "2012-06-04 16:21:00", parent_id: nil, slug: "art">
1.9.3-p125 :009 > creativity.siblings
Tag Load (0.6ms) SELECT tags.* FROM tags WHERE tags.parent = 26 AND (tags.id != 10) ORDER BY tags.title ASC
ActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'tags.parent' in 'where clause': SELECT tags.* FROM tags WHERE tags.parent = 26 AND (tags.id != 10) ORDER BY tags.title ASC

mceachen added a commit that referenced this pull request Jun 11, 2012
Failing when requesting siblings. Tests forthcoming.
@mceachen mceachen merged commit adfadd9 into ClosureTree:master Jun 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants