lib/tasks/db.rake in wcc-base-0.2.0 vs lib/tasks/db.rake in wcc-base-0.2.1
- old
+ new
@@ -20,10 +20,14 @@
def self.mysql?
db_config["adapter"] == "mysql"
end
def self.db_config_file_data
- YAML.load_file("config/database.yml")
+ if defined?(ActiveRecord::Base)
+ ActiveRecord::Base.configurations
+ else
+ YAML.load_file("config/database.yml")
+ end
rescue SystemCallError
{}
end
end