% @allow_ruling_timer = (current_user && (current_user.is_admin? || RulingTimerSetting.first.authorize?(current_user) rescue false)) %> <% if @allow_ruling_timer %> <%= csrf_meta_tags %> <% @ruling_timer_temp = RulingTimerTemp.where(:user=>current_user).first %> <% @ruling_timer_temp = RulingTimerTemp.new if @ruling_timer_temp.nil? %> <% @ruling_timer_temp.check_and_store %> <% @new_sub_tasks = RulingTimerSubTask.where(:user=>current_user,:status.ne=>"finish",:id.nin=>@ruling_timer_temp.sub_task_ids).to_a %>