mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
13 lines
239 B
Ruby
13 lines
239 B
Ruby
|
class PriceCategory < ActiveRecord::Base
|
||
|
has_many :event_price_category
|
||
|
has_many :events, through: :event_price_categories
|
||
|
|
||
|
def safe_destroy
|
||
|
if event_price_category.count == 0
|
||
|
destroy
|
||
|
else
|
||
|
false
|
||
|
end
|
||
|
end
|
||
|
end
|