Permalink
Browse files

Merge pull request #6765 from frodsan/fix_build_railties

Fix build: check if sqlite3 file exists before remove
  • Loading branch information...
2 parents 7571408 + b6d2997 commit b9660bdac5ea2a632cdfbbf660e35ef1b7d1723c @rafaelfranca rafaelfranca committed Jun 18, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/tasks/sqlite_database_tasks.rb
@@ -1,12 +1,12 @@
class ActiveRecord::Tasks::SQLiteDatabaseTasks
- delegate :connection, :establish_connection, :to => ActiveRecord::Base
+ delegate :connection, :establish_connection, to: ActiveRecord::Base
def initialize(configuration, root = Rails.root)
@configuration, @root = configuration, root
end
def create
- if File.exist? configuration['database']
+ if File.exist?(configuration['database'])
$stderr.puts "#{configuration['database']} already exists"
return
end
@@ -20,7 +20,7 @@ def drop
path = Pathname.new configuration['database']
file = path.absolute? ? path.to_s : File.join(root, path)
- FileUtils.rm(file)
+ FileUtils.rm(file) if File.exist?(file)
end
alias :purge :drop

0 comments on commit b9660bd

Please sign in to comment.