-
-
Save soniagrajales/01392dfa4de3e3e22b96 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
ev=Event.find 33701 | |
parent_problematic = [] | |
# get parent registrations | |
ev.event_registrations.where("parent_registration_id IS NOT NULL").map{|r| | |
r.parent_registration_id}.uniq.each do |parent_registration_id| | |
parent_registration = nil | |
begin | |
parent_registration = EventRegistration.find(parent_registration_id) | |
rescue | |
#break | |
end | |
if !parent_registration.nil? and (parent_registration.status == 'Complete' || parent_registration.status == 'rm_pending') and parent_registration.processed == true | |
children_registrations = parent_registration.children_registrations.where("processed = false AND status='Expired' AND cost IS NOT NULL") | |
if children_registrations.size > 0 | |
parent_problematic << parent_registration_id | |
end | |
end | |
puts "PARENTS OF PROBLEMATIC REGISTRATIONS \n" | |
puts parent_problematic.join(', ') | |
puts "=========================================================" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Step 1 for identifying parent (primary registration) of problematic piggyback registration