1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-04 15:24:23 +01:00
fab-manager/app/models/age_range.rb

15 lines
235 B
Ruby
Raw Normal View History

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