class FloorSubUnit include Mongoid::Document include Mongoid::Timestamps include Slug field :title, as: :slug_title, localize: true has_many :floor_sub_unit_images, :autosave => true, :dependent => :destroy belongs_to :floor_unit end