mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
15 lines
230 B
Ruby
15 lines
230 B
Ruby
class AgeRange < ApplicationRecord
|
|
extend FriendlyId
|
|
friendly_id :name, use: :slugged
|
|
|
|
has_many :events, dependent: :nullify
|
|
|
|
def safe_destroy
|
|
if events.count.zero?
|
|
destroy
|
|
else
|
|
false
|
|
end
|
|
end
|
|
end
|