aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-06-17 22:40:12 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-06-17 22:40:12 -0700
commitb9660bdac5ea2a632cdfbbf660e35ef1b7d1723c (patch)
tree561c1fc24bebfd3f75cbac8a9cd881e50e6bd9fe /activerecord/lib/active_record
parent757140823b2217301911efd531396bfb8f5c9a42 (diff)
parentb6d2997669a0bbce4ce0b5142237c2a91852d16e (diff)
downloadrails-b9660bdac5ea2a632cdfbbf660e35ef1b7d1723c.tar.gz
rails-b9660bdac5ea2a632cdfbbf660e35ef1b7d1723c.tar.bz2
rails-b9660bdac5ea2a632cdfbbf660e35ef1b7d1723c.zip
Merge pull request #6765 from frodsan/fix_build_railties
Fix build: check if sqlite3 file exists before remove
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/tasks/sqlite_database_tasks.rb6
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