Permalink
Browse files

do not access internal data structures

  • Loading branch information...
1 parent 5751689 commit 51703256982ed2879b8b154917640b8bd8e05ae8 @tenderlove tenderlove committed Sep 20, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/preloader.rb
@@ -143,7 +143,7 @@ def grouped_records(association)
def records_by_reflection(association)
records.group_by do |record|
- reflection = record.class.reflections[association]
+ reflection = record.class.reflect_on_association(association)
unless reflection
raise ActiveRecord::ConfigurationError, "Association named '#{association}' was not found; " \

0 comments on commit 5170325

Please sign in to comment.