Skip to content

Instantly share code, notes, and snippets.

@aleksb86
Last active August 11, 2020 09:48
Show Gist options
  • Save aleksb86/538f19c2ec0518420d515f829efca8cf to your computer and use it in GitHub Desktop.
Save aleksb86/538f19c2ec0518420d515f829efca8cf to your computer and use it in GitHub Desktop.
Quering with Active Record json fields (PostgreSQL)
Orchestrator::Models::Order.where("params ->> 'parent_order_id' = :id", id: '2403')
VmOrder.where("params -> 'os' ? :os", os: 'RHEL 7.6 x64').first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment