rom-rb / rom-factory

Data generator with support for persistence backends
MIT License
83 stars 42 forks source link

Allow DATABASE_URL from env #31

Closed ianks closed 6 years ago

ianks commented 6 years ago

This PR lowers the barrier of entry for contributing by allowing a developer to specify DATABASE_URL to use in specs. To be safe, we make sure this DATABASE_URL is a local database.

v-kolesnikov commented 6 years ago

LGFM 👍 I'm not sure it's a true way to prevent using any database url, but I understand the reason you do that - 'DATABASE_URL' might exist occasionally in your environment. So it probably would be better to use another name of this variable, e.g. 'ROM_DATABASE_URL'. What do you think?

cc @solnic

ianks commented 6 years ago

That's fine too 😀 I'll make the change and remove the check.

solnic commented 6 years ago

We use DATABASE_URL in all other projects, so let's stick to it.

solnic commented 6 years ago

Hmm, this failed on jruby https://travis-ci.org/rom-rb/rom-factory/jobs/436519659#L590

v-kolesnikov commented 6 years ago

Hah. Yes. Because of that:

>> URI('jdbc:postgresql://localhost/rom_factory').host
=> nil
>>