diff --git a/app/models/build_list.rb b/app/models/build_list.rb index e0ba5bc7c..4d6cefaf2 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -99,10 +99,8 @@ class BuildList < ActiveRecord::Base before_create :set_default_status after_create :place_build - class << self - def human_status(status) - I18n.t("layout.build_lists.statuses.#{HUMAN_STATUSES[status]}") - end + def self.human_status(status) + I18n.t("layout.build_lists.statuses.#{HUMAN_STATUSES[status]}") end def human_status diff --git a/lib/tasks/buildlist.rake b/lib/tasks/buildlist.rake index 080f97818..ea6a40eff 100644 --- a/lib/tasks/buildlist.rake +++ b/lib/tasks/buildlist.rake @@ -8,11 +8,7 @@ namespace :buildlist do outdated = BuildList.outdated say "There are #{outdated.count} outdated BuildLists at #{Time.now}" - begin - BuildList.outdated.map(&:destroy) - rescue Exception => e - say "There was an error: #{e.message}" - end + BuildList.outdated.destroy_all say "Outdated BuildLists was successfully removed" end