If eager loading, clone the dataset and set a flag to let each know not to call all, to avoid the infinite loop.
[Source]
# File lib/sequel/plugins/eager_each.rb, line 37 37: def all(&block) 38: if use_eager_all? 39: clone(:all_called=>true).all(&block) 40: else 41: super 42: end 43: end
Call all instead of each if eager loading, uless each is being called by all.
# File lib/sequel/plugins/eager_each.rb, line 27 27: def each(&block) 28: if use_eager_all? 29: all(&block) 30: else 31: super 32: end 33: end
[Validate]