Sha256: a75f97e6fcc0d08fcac4363c43d8939df237cbb4fc7095a21f84d574153a9814

Contents?: true

Size: 626 Bytes

Versions: 30

Compression:

Stored size: 626 Bytes

Contents

module SiblingsNavigation

  def next_for(user)
    user.pending_siblings_at(self).select { |it| it.number > number }.sort_by(&:number).first
  end

  def restart(user)
    user.pending_siblings_at(self).sort_by(&:number).first
  end

  def siblings
    structural_parent.structural_children
  end

  def pending_siblings_for(user, organization=Organization.current)
    siblings.reject { |it| it.progress_for(user, organization).completed? }
  end

  # Names

  def navigable_name
    "#{number}. #{name}"
  end

  # Answers a - maybe empty - list of pending siblings for the given user
  #required :pending_siblings_for
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mumuki-domain-9.23.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.22.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.22.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.21.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.20.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.19.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.18.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.17.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.16.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.15.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.14.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.14.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.13.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.13.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.12.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.11.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.10.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.9.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.8.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-9.8.0 app/models/concerns/navigation/siblings_navigation.rb