nccu-news/app/models/unit.rb

14 lines
312 B
Ruby

# encoding: utf-8
class Unit
include Mongoid::Document
include Mongoid::Timestamps
include Slug
field :name, as: :slug_title, :localize => true
field :sort_number, type: Integer
has_many :departments, :dependent => :destroy
accepts_nested_attributes_for :departments, :allow_destroy => true
end