1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/models/age_range.rb
2020-03-30 11:33:12 +02:00

18 lines
272 B
Ruby

# frozen_string_literal: true
# AgeRange
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