ensure that Association#with_each_shard doesn't use loaded results

Change-Id: Id36a367ea5f135f87e548c64afe8b0c640b6acfc
Reviewed-on: https://gerrit.instructure.com/31443
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2014-03-06 10:17:41 -07:00
parent 5631eb41ec
commit 5ba4c8e529
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ module ActiveRecord::Associations
%w{HasManyAssociation HasManyThroughAssociation}.each do |klass|
const_get(klass).class_eval do
def with_each_shard(*shards)
scope = self
scope = self.scoped
scope = yield(scope) if block_given?
Array(scope)
end