Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eliank/070201b88929b68dc542f056e221e666 to your computer and use it in GitHub Desktop.
Save eliank/070201b88929b68dc542f056e221e666 to your computer and use it in GitHub Desktop.
SomeModel.where(some_variable: %i(some_value another_value yet_another_value)).where(“some_date <= ?”, Time.zone.today).select(:id)
.find_each_with_order(additional_order_column: :some_variable) do |some_model_id|
# do something
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment