nccu-news/app/models/unit.rb

14 lines
312 B
Ruby
Raw Normal View History

2014-11-07 08:44:11 +00:00
# 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
2015-09-24 07:41:36 +00:00
has_many :departments, :dependent => :destroy
2014-11-07 08:44:11 +00:00
accepts_nested_attributes_for :departments, :allow_destroy => true
end