Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.* FROMtags
WHEREtags
.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
.* FROMtags
WHEREtags
.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
.* FROMtags
WHEREtags
.parent
= 26 AND (tags
.id != 10) ORDER BY tags.title ASCActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'tags.parent' in 'where clause': SELECT
tags
.* FROMtags
WHEREtags
.parent
= 26 AND (tags
.id != 10) ORDER BY tags.title ASC