I've found it's pretty easy to accidentally load the rails env in
rake, especially when you're the poor "next guy" managing the project.
A lil shell script might be nice, though.

I'm all for copy and paste driven development, as long as you
understand what you're doing. ;-)

-Greg


On 15 August 2012 15:01, Nathan de Vries <[email protected]> wrote:
> If you're unable to write a script or rake task without loading in
> unnecessary dependencies, it might be best to stick to
> copypasta-driven-development :-)
>
> On 14/08/2012, at 9:42 PM, Michael Pearson wrote:
>
> Invoking rake will (usually) invoke config/environment .. which will attempt
> to ERB database.yml..
>
> I'm sure you can see where this is going ;)
>
> On Wed, Aug 15, 2012 at 2:41 PM, Nathan de Vries <[email protected]> wrote:
>>
>> Couldn't you create a script or rake task which outputs a branch-specific
>> database name? That way you'd have:
>>
>>   development:
>>     adapter: postgresql
>>     database: <%= `rake db:branch_specific_database_name` -%>
>>     timeout: 5000
>>     host: /var/pgsql_socket
>>
>> —Nathan
>>
>> On 14/08/2012, at 9:28 PM, Mikel Lindsaar wrote:
>>
>> Some of you asked me last night about the database.yml code I went over in
>> last nights lightning talk.
>>
>> It's now online here: http://reinteractive.net/posts
>>
>> Thanks :)
>>
>> Mikel
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby or Rails Oceania" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/rails-oceania?hl=en.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby or Rails Oceania" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/rails-oceania?hl=en.
>
>
>
>
> --
> Michael Pearson
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to