Skip to content

Instantly share code, notes, and snippets.

@joeyates
Created April 10, 2018 09:36
Show Gist options
  • Save joeyates/487f3399e75aac4e948246e928f379a5 to your computer and use it in GitHub Desktop.
Save joeyates/487f3399e75aac4e948246e928f379a5 to your computer and use it in GitHub Desktop.
Use Chewy to extract a date range
bars =
FooIndex::Bar.all.
query(range: {start_date: {lt: "2018-03-31"}}).
query(range: {end_date: {gt: "2018-03-31"}}).
load.to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment