How to access content database.ymlinside ActiveRecord migration? In particular, I need a key value databasefor the migrated database.
database.yml
database
db = YAML.load_file("#{RAILS_ROOT}/config/database.yml")[RAILS_ENV]['database']
Try ActiveRecord::Base.configurations
ActiveRecord::Base.configurations
Source: https://habr.com/ru/post/1761136/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1761131/what-are-good-default-items-to-add-to-hgignore-when-using-eclipse&usg=ALkJrhhkQ0pApH_6X66xpTvLoA_noJOmSQsed or awk to print lines between words - sedConvert text field text to integer - c #Why are my local dlls permanently loaded after installing _NT_SYMBOL_PATH? - c ++strange behavior with the sentence "IN" works - stringЕсть ли в Ruby аналог метода python vars()? - pythonCreate a function to scroll through method properties in C #? - functionОпределение проблем, связанных с эндией - c++Encrypt a string in Java so that C can decrypt it without any additions to the decrypted text? - javaNeed help with perl peak detection - perlAll Articles