Sha256: 5fa62860d9059f3ef996601754633b0e9b2e6851c0c2db1ca8b28077028c0f02

Contents?: true

Size: 697 Bytes

Versions: 20

Compression:

Stored size: 697 Bytes

Contents

module SiblingsNavigation

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

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

  def siblings
    structural_parent.structural_children
  end

  #TODO reestablish this after indicators reliably linked to assignments
  # 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

20 entries across 20 versions & 2 rubygems

Version Path
mumuki-domain-7.7.3 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.7.2 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.7.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-laboratory-7.7.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-cb7a9018bb94/app/models/concerns/navigation/siblings_navigation.rb
mumuki-laboratory-7.7.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-cb7a9018bb94/app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.7.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.6.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.6.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-laboratory-7.5.2 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-ad16a5930cec/app/models/concerns/navigation/siblings_navigation.rb
mumuki-laboratory-7.5.1 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-a059418e5fd8/app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.5.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-laboratory-7.5.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-acb12583b793/app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.5.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.4.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.4.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.3.2 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.3.1 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.2.3 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.3.0 app/models/concerns/navigation/siblings_navigation.rb
mumuki-domain-7.2.2 app/models/concerns/navigation/siblings_navigation.rb