Module: Sunrise::Models::Structure

Extended by:
ActiveSupport::Concern
Included in:
Structure
Defined in:
lib/sunrise/models/structure.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#descendants_countObject



47
48
49
# File 'lib/sunrise/models/structure.rb', line 47

def descendants_count
  (right - left - 1) / 2
end

#moveable?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/sunrise/models/structure.rb', line 43

def moveable?
  new_record? || !root?
end