On Tue, Jul 17, 2012 at 9:59 AM, David Rubin <david...@gmail.com> wrote: > HI Guys, > > I recently tried VERY hard to override the database configuration bassed on > ENV vars or actual API calls. This task is almost next to impossible. > > I know that the database.yml file is parsed as ERB but that is sane for > simple ENV replacement if you want to actually change which database adaptor > it is (requires extra config/params) it becomes messy. > > I found https://github.com/rails/rails/issues/5297 which explains the > issue/solution far better then I could. > > Active record supports this natively, I can't see why rails would force the > requirement of a database.yml and for it to have a "production" section. see > http://apidock.com/rails/ActiveRecord/Base/establish_connection/class URL > section.
As I mentioned on the ticket, I would rather have ENV["DATABASE_URL"] supported as well, but I can't see how it's "VERY hard to override". See https://github.com/rails/rails/issues/5297#issuecomment-7037942 I've been using variations of that for a long time, and it works pretty well. Cheers, -foca > Regards > > David > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/8qOi7BryxukJ. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.