Merge pull request #1214 from NullVoxPopuli/issue/1211-failing-test

Fix #1211, include_tree is null when using the key: options
This commit is contained in:
Lucas Hosseini
2015-10-02 15:29:04 +02:00
3 changed files with 20 additions and 1 deletions

View File

@@ -92,7 +92,8 @@ module ActiveModel
Enumerator.new do |y|
self.class._reflections.each do |reflection|
next unless include_tree.key?(reflection.name)
key = reflection.options.fetch(:key, reflection.name)
next unless include_tree.key?(key)
y.yield reflection.build_association(self, instance_options)
end
end