GithubHelp home page GithubHelp logo

batched_query's People

Contributors

edmundmai avatar

Stargazers

 avatar

Watchers

 avatar  avatar

batched_query's Issues

Garbage code causing gem error ?

At file lib/batched_query/runner.rb at the end of the file:

# Any ActiveRecord query
cars = Car.where("brand_name = 'Ferrari'")order("created_at desc")

# Set the limit of each subquery
BatchedQuery::Runner.limit = 100
BatchedQuery::Runner.each_set(cars) do |batch_of_cars|
  # process results in manageable subsets
  batch_of_cars.map { |car| ... }
end

BatchedQuery::Runner.limit = 200
BatchedQuery::Runner.each_result(cars) do |car|
  # access each car as if you loaded all of the records at once
  car.start!
end
end

I dont understand what's that doing there, it gets executed as soon as you do rails s in your app and the following line:

cars = Car.where("brand_name = 'Ferrari'")order("created_at desc")

triggers a syntax error => notice order without the dot before the parenthesis...

Note the gem was install using bundle install,

Gemfile.lock relevant line:
batched_query (0.0.1)

Gemfile:
gem 'batched_query'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.