1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-05 16:24:21 +01:00
fab-manager/app/models/event_theme.rb

15 lines
286 B
Ruby
Raw Normal View History

2016-06-28 15:56:37 +02:00
class EventTheme < ActiveRecord::Base
extend FriendlyId
friendly_id :name, use: :slugged
has_and_belongs_to_many :events, join_table: :events_event_themes, dependent: :destroy
def safe_destroy
if self.events.count == 0
destroy
else
false
end
end
2016-06-28 15:56:37 +02:00
end