Created
May 4, 2017 15:12
-
-
Save StaverDmitry/c446dbb43e3ddebd207c45c324f84d44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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