mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +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
|
class AgeRange < ActiveRecord::Base
|
||||||
has_many :events
|
has_many :events, dependent: :nullify
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
class Category < ActiveRecord::Base
|
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
|
end
|
||||||
|
@ -8,7 +8,7 @@ class Event < ActiveRecord::Base
|
|||||||
has_and_belongs_to_many :categories, join_table: :events_categories
|
has_and_belongs_to_many :categories, join_table: :events_categories
|
||||||
validates :categories, presence: true
|
validates :categories, presence: true
|
||||||
has_many :reservations, as: :reservable, dependent: :destroy
|
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
|
belongs_to :age_range
|
||||||
|
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
class EventTheme < ActiveRecord::Base
|
class EventTheme < ActiveRecord::Base
|
||||||
|
has_and_belongs_to_many :events, join_table: :events_event_themes, dependent: :destroy
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user