Sha256: 73781e545097ccb8b8ff7ed783129dbf75586b8564048558fb6ceea397a84ff9
Contents?: true
Size: 1.09 KB
Versions: 40
Compression:
Stored size: 1.09 KB
Contents
class WelcomeController < ApplicationController def index flash.keep if Task.find_started.size > 0 redirect_to :controller => 'tasks', :action => :list_started return end if Backlog.count == 0 redirect_to :controller => 'backlogs', :action => :new return end active_periods = Period.find(:all).select {|period| period.active?(true)} my_active_periods = active_periods.select {|period| period.party.includes?(current_user)} unless my_active_periods.empty? my_active_periods = my_active_periods.sort_by {|p| p.required_speed} my_active_periods_required_speed = my_active_periods.map {|p| p.required_speed} most_urgent_period = my_active_periods.last else most_urgent_period = active_periods.sort_by {|p| p.required_speed}.last end if most_urgent_period redirect_to :controller => 'periods', :action => :show, :id => most_urgent_period return end most_urgent_backlog = Backlog.find(:first, :order => :id) redirect_to :controller => 'backlogs', :action => :show, :id => most_urgent_backlog.id end end
Version data entries
40 entries across 40 versions & 1 rubygems