fix association handling for Rails 3.1