mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
remove associations with events on filter deletion
This commit is contained in:
parent
e13870555b
commit
eb7ee6300e
@ -1,3 +1,3 @@
|
||||
class AgeRange < ActiveRecord::Base
|
||||
has_many :events
|
||||
has_many :events, dependent: :nullify
|
||||
end
|
||||
|
@ -1,3 +1,3 @@
|
||||
class Category < ActiveRecord::Base
|
||||
has_and_belongs_to_many :events, join_table: :events_categories
|
||||
has_and_belongs_to_many :events, join_table: :events_categories, dependent: :destroy
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ class Event < ActiveRecord::Base
|
||||
has_and_belongs_to_many :categories, join_table: :events_categories
|
||||
validates :categories, presence: true
|
||||
has_many :reservations, as: :reservable, dependent: :destroy
|
||||
has_and_belongs_to_many :event_themes, join_table: :events_event_themes
|
||||
has_and_belongs_to_many :event_themes, join_table: :events_event_themes, dependent: :destroy
|
||||
|
||||
belongs_to :age_range
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
class EventTheme < ActiveRecord::Base
|
||||
has_and_belongs_to_many :events, join_table: :events_event_themes, dependent: :destroy
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user