collectiveidea/awesome_nested_set — pull request #165 by aserafin (2012-12-05 13:46:51+00:00)
Title: Fix for error when you use acts_as_nested_set in model that has default_scope order(...) defined

Hi,

I've fixed error that I had today with awesome_nested_set today. Problem occurs when you have model defined with additional column, in my case integer column position (to order categories), and a `default_scope` is defined with order on that column. In this situation when you call `Model.rebuild!` you get postgresql exception error with grouping. Fix was easy - I've just wrapped `rebuild!` method code into a `unscoped do ... end`. I've also added a test that fails without this change when you run tests with DB=postgresql.

I hope you will consider accepting this pull request.

Adrian