lib/tickethub/collection.rb in tickethub-0.3.75 vs lib/tickethub/collection.rb in tickethub-0.3.76

- old
+ new

@@ -28,18 +28,18 @@ klass.collection_methods.merge(klass.scopes).each do |key, block| define_singleton_method key, &block end super() do |yielder| - self.reload! if cache.nil? + self.reload! if self.cache.nil? - cache.each do |row| + self.cache.each do |row| yielder << @klass.call(endpoint, row) end - while (offset + cache.length) < count - response = endpoint.get params.merge(offset: cache.length) - response.decoded.each do |row| cache << row + while (offset + self.cache.length) < count + response = endpoint.get params.merge(offset: self.cache.length) + response.decoded.each do |row| self.cache << row yielder << @klass.call(endpoint, row) end end end end \ No newline at end of file