Skip to content

Instantly share code, notes, and snippets.

@mudhappy
Created July 24, 2019 18:39
Show Gist options
  • Save mudhappy/d21263df16d41b8bda62580ca4de7e1f to your computer and use it in GitHub Desktop.
Save mudhappy/d21263df16d41b8bda62580ca4de7e1f to your computer and use it in GitHub Desktop.
edit
@offline_sales = OfflineSale.where("cod_1 = ?", @offline_sale.cod_1).pluck(:id)
if @offline_sale.cod_1 && @offline_sales
@disaggregates = DisaggregatedOfflineSale.where(offline_sale_id: @offline_sales).order(:service)
else
@disaggregates = DisaggregatedOfflineSale.where(offline_sale_id: @offline_sale.id).order(:service)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment