class Floor include Mongoid::Document include Mongoid::Timestamps include Slug field :title, as: :slug_title field :layout mount_uploader :layout_image, ImageUploader belongs_to :building has_many :floor_units, :dependent => :destroy end