Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save richiethomas/ddf00c4aa11a1a93af1bbcb0e22c202a to your computer and use it in GitHub Desktop.
Save richiethomas/ddf00c4aa11a1a93af1bbcb0e22c202a to your computer and use it in GitHub Desktop.
items = LineItem.unscoped.where(reference_type: 'packaging').by_facility('AR').where.not(archived_at: nil)
items.update_attributes(archived_at: nil)
PurchaseOrder.unscoped.find(items.pluck(:purchase_order_id)).update_attributes(archived_at: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment