-
-
Save soniagrajales/7af87c763f5aff6f617c 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
# The following is the example of how I corrected the piggyback registrations associated to the user Nathan Archuleta | |
# with rm_user_id 187181 for the event with id 24521 | |
reg_complete=EventRegistration.first(:conditions => { :event_id => 24521,:rm_user_id => 187181,:processed => true }) # find the parent and complete registration | |
EventRegistration.where(:event_id => 24521,:rm_user_id => 187181,:invoice_code => nil, :cost => nil, :service_fee => nil, :payment_notes => nil).each do |incomplete| # find the incomplete registrations and iterate over them | |
puts "CORRECTING EVENT REGISTRATION #{ incomplete.id }" | |
incomplete.processed = reg_complete.processed # update the processed field of the incomplete registration and set the processed value of the complete registration | |
incomplete.status = reg_complete.status # update the status field of the incomplete registration and set the status value of the complete registration | |
incomplete.cost = reg_complete.cost # update the cost field of the incomplete registration and set the cost value of the complete registration | |
incomplete.service_fee = reg_complete.service_fee # update the service_fee field of the incomplete registration and set the service_fee value of the complete registration | |
incomplete.club_team = reg_complete.club_team # update the club_team field of the incomplete registration and set the club_team value of the complete registration | |
incomplete.team_type = reg_complete.team_type # update the team_type field of the incomplete registration and set the team_type value of the complete registration | |
incomplete.team_id = reg_complete.team_id # update the team_id field of the incomplete registration and set the team_id value of the complete registration | |
incomplete.save # save changes made in the incomplete registration | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Step 2 - fixing problematic piggyback registrations