registration#delete: retain ticket purchases
This commit is contained in:
parent
85fcd4e1b7
commit
d1c0c7d97a
5 changed files with 55 additions and 28 deletions
|
|
@ -29,7 +29,6 @@ class Registration < ActiveRecord::Base
|
|||
validate :registration_to_events_only_if_present
|
||||
|
||||
after_create :set_week, :subscribe_to_conference, :send_registration_mail
|
||||
after_destroy :destroy_purchased_tickets
|
||||
|
||||
##
|
||||
# Makes a list of events that includes (in that order):
|
||||
|
|
@ -60,11 +59,6 @@ class Registration < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def destroy_purchased_tickets
|
||||
ticket_purchased = TicketPurchase.where(conference_id: conference_id, user_id: user.id)
|
||||
ticket_purchased.destroy_all
|
||||
end
|
||||
|
||||
def subscribe_to_conference
|
||||
Subscription.create(conference_id: conference.id, user_id: user.id)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue