Adds dependent restricted association to some models

fix #348
This commit is contained in:
chrisbr 2014-12-18 13:38:40 +01:00
parent 87b1aba1e9
commit 799fd0c3a4
19 changed files with 65 additions and 66 deletions

View file

@ -1,6 +1,6 @@
class Ticket < ActiveRecord::Base
belongs_to :conference
has_many :ticket_purchases
has_many :ticket_purchases, dependent: :destroy
has_many :buyers, -> { distinct }, through: :ticket_purchases, source: :user
attr_accessible :conference, :title, :url, :description, :conference_id, :price_cents, :price_currency, :price