lib/reptile/databases.rb in reptile-0.0.1 vs lib/reptile/databases.rb in reptile-0.0.4
- old
+ new
@@ -20,19 +20,19 @@
private
def get_masters
masters = databases.dup
- masters.each_key{|key| masters.delete(key) if masters[key]['master'].nil? }
- masters.each_key{|key| masters[key] = masters[key]['master'] }
+ masters.each_key{|name| masters.delete(name) if masters[name]['master'].nil? }
+ masters.each_key{|name| masters[name] = masters[name]['master'] }
masters
end
# TODO: make private
def get_slaves
dbs = databases.dup
- dbs.each_key{|name| dbs.delete(key) if dbs[name]['slave'].nil? }
+ dbs.each_key{|name| dbs.delete(name) if dbs[name]['slave'].nil? }
dbs.each_key{|name| dbs[name] = dbs[name]['slave'] }
slaves = dbs
end
# Tries to establish a database connection, and returns that connection.
@@ -42,10 +42,10 @@
ActiveRecord::Base.connection
rescue Exception => e
puts "****"
puts "Error connecting to database: #{e}"
puts "****"
- puts YAML::dump(configs)
+ puts configs.inspect
exit 1
end
end
end
\ No newline at end of file