class Building include Mongoid::Document include Mongoid::Timestamps include Slug field :title, as: :slug_title, localize: true mount_uploader :image, ImageUploader has_many :floors, :dependent => :destroy end