Module: Skyline::Positionable

Included in:
Page
Defined in:
lib/skyline/positionable.rb

Overview

Positionable automatically adds the last position number to ActiveRecord models in the ‘position` column. It only set’s the position if it isn’t set yet.

By defining an optional scope the position numbering will only look inside a certain scope.

Examples:

Usage:

class Model < ActiveRecord::Base
  include Skyline::Positionable
  self.positionable_scope = :parent_id   # (Optional)
end

Defined Under Namespace

Modules: ClassMethods