fix outer_joins in rails3
not set class variable for current_user_proc, use Thread.current
fix sorting tests