How do I access the contents of database.yml
inside an ActiveRecord migration? Specifically, I need the value of the database
key for the database being migrated.
views:
18answers:
2
+1
A:
db = YAML.load_file("#{RAILS_ROOT}/config/database.yml")[RAILS_ENV]['database']
Ashwin Phatak
2010-08-23 15:32:53
That did it. ThankYou();
landon9720
2010-08-23 15:34:35