mceachen/closure_tree — pull request #8 by eljojo (2012-06-04 16:52:05+00:00)
Title: Failing when requesting siblings

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
=> #
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
=> #
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