ruling_timer/app/models/ruling_timer_section.rb

11 lines
386 B
Ruby
Raw Normal View History

2022-04-18 01:01:57 +00:00
class RulingTimerSection
include Mongoid::Document
include Mongoid::Timestamps
field :section_name, type: String, default: ""
belongs_to :ruling_timer_project
has_many :ruling_timer_task
field :task_count, type: Integer, default: 0
after_destroy do |record|
RulingTimerTask.where(:ruling_timer_section_id=>record.id).update_all(:ruling_timer_section_id=>nil)
end
end