diff options
-rw-r--r-- | activerecord/lib/active_record/tasks/sqlite_database_tasks.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb b/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb index 4d3cba8a50..d337b95a2a 100644 --- a/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb +++ b/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 @@ class ActiveRecord::Tasks::SQLiteDatabaseTasks 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 |