diff --git a/lib/travis/model/build.rb b/lib/travis/model/build.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/model/build.rb
+++ b/lib/travis/model/build.rb
@@ -66,7 +66,6 @@ class Build < ActiveRecord::Base
     end
 
     def next_number
-      env = defined?(Rails) ? Rails.env : ENV['ENV'] || ENV['RAILS_ENV'] || 'test'
       maximum(floor('number')).to_i + 1
     end
env isn't used anywhere, so i am pretty sure it can be removed