config.active_record.configure do |db|
db.database = 'test_app_production'
db.socket = IO.popen("mysql --help") {|f| f.read() =~ /^socket(.+)
$/ && $1.strip }
db.credentials = "#{ENV["home"]}/.my.cnf"
end
Good idea or not, I'm just throwing it out there. Not that you
couldn't have done this in yml but...
on 2008-06-13 05:46
on 2008-06-13 06:15
On Thu, Jun 12, 2008 at 8:45 PM, frogstarr78 <frogstarr78@gmail.com> wrote: > > config.active_record.configure do |db| > db.database = 'test_app_production' > db.socket = IO.popen("mysql --help") {|f| f.read() =~ /^socket(.+) > $/ && $1.strip } > db.credentials = "#{ENV["home"]}/.my.cnf" > end > > Good idea or not, I'm just throwing it out there. Not that you > couldn't have done this in yml but... db.socket = `mysql_config --socket`.strip even :) jeremy