Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save StaverDmitry/c446dbb43e3ddebd207c45c324f84d44 to your computer and use it in GitHub Desktop.
Save StaverDmitry/c446dbb43e3ddebd207c45c324f84d44 to your computer and use it in GitHub Desktop.
def archive
ReconciliationEvent.find_or_create_by(payment_id: params[:id], reconciliation_date: Time.now)
render :json =>{"msg"=>Payment.update(params[:id], is_archive: true)}
end
def archive_selected
count=0
Payment.where(id: params[:ids]).each do |x|
Payment.update(x.id, is_archive: true)
ReconciliationEvent.find_or_create_by(payment_id: x.id, reconciliation_date: Time.now)
count+=1
end
render :json =>{"msg"=>count}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment