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:
parent
5631eb41ec
commit
5ba4c8e529
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue