app/controllers/employees_controller.rb
def load_active_years
      @active_years = FiscalYear.active_fiscal_years
      @year = FiscalYear.find_by_year(cookies[:year])
      if @year.blank? || !@year.active
         flash[:message] = "Selected year #{@year.year} inactive. Year changed to #{@current_fiscal_year.year}." if @year
        @year = @current_fiscal_year
      end
    end
# Loads all active years. Loads the last selected year if it is active
Loads all active years. Loads the last selected year if it is active
Loads all active years . Loads the last selected year if it is active
def load_active_years
      @active_years = FiscalYear.active_fiscal_years
      @year = FiscalYear.find_by_year(cookies[:year])
      if @year.blank? || !@year.active
         flash[:message] = "Selected year #{@year.year} inactive. Year changed to #{@current_fiscal_year.year}." if @year
        @year = @current_fiscal_year
      end
    end
def load_active_years @active_years = FiscalYear . active_fiscal_years @year = FiscalYear . find_by_year ( cookies [ :year ] ) if @year . blank? || ! @year . active flash [ :message ] = "Selected year #{@year.year} inactive. Year changed to #{@current_fiscal_year.year}." if @year @year = @current_fiscal_year end end
Loads all active years.
Loads all active years .