Module: Plutonium::Definition::Positioning

Extended by:
ActiveSupport::Concern
Defined in:
lib/plutonium/definition/positioning.rb

Overview

Declares a resource drag-orderable. The MODEL owns how positions are stored (positioned_on :sort_order, scope: :project_id); this only says "this UI can be reordered", and never restates the column or the scope.

position_on                      # Mode A, follows the model's column
position_on :sort_order          # Mode A, must MATCH the model's column
position_on(:rank) { |move|  }  # Mode B, another gem owns the write
position_on false                # Mode C, ordering off

Mirrors kanban's position_on (lib/plutonium/kanban/dsl.rb) exactly, and builds the same Plutonium::Positioning::Config. Deliberately the same verb rather than a third one: the model says positioned_on, every UI layer says position_on, and a kanban board with no position_on of its own inherits the definition's (see Kanban::Board#position_config_for).

Instance Method Summary collapse

Instance Method Details

#defined_position_configObject



123
# File 'lib/plutonium/definition/positioning.rb', line 123

def defined_position_config = self.class.defined_position_config