class Section
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name
  field :sort, type: Integer, default: 0

  has_many :nodes, dependent: :destroy
end

class Section
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name
  field :sort, type: Integer, default: 0

  has_many :nodes, dependent: :destroy

  default_scope { desc(:sort) }

end

Use the default_scope macro to set a default scope for all operations on the model.
Use the default_scope macro to set a default scope for all operations on the model.
