Forum: Rails-core (closed, excessive spam) Just a thought

Posted by frogstarr78 (Guest)
on 2008-06-13 05:46
(Received via mailing list)
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...
Posted by Jeremy Kemper (Guest)
on 2008-06-13 06:15
(Received via mailing list)
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
This topic is locked and can not be replied to.