Skip to content

Instantly share code, notes, and snippets.

@thescubageek
Created October 4, 2017 19:20
Show Gist options
  • Save thescubageek/1cdaddd04a4f437b5eec50718cd08245 to your computer and use it in GitHub Desktop.
Save thescubageek/1cdaddd04a4f437b5eec50718cd08245 to your computer and use it in GitHub Desktop.
WIP: Find and return ActiveRecord models by attribute according to specific order
Widget.where(id: child_widget_ids).index_by(&:id).values_at(*child_widget_ids).squish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment