Created
September 7, 2018 13:58
-
-
Save 9876691/69a4024c51d5820048fce0d201538568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LuckyRecord::Repo.configure do | |
if Lucky::Env.production? | |
settings.url = ENV.fetch("DATABASE_URL") | |
else | |
settings.url = ENV["DATABASE_URL"]? || | |
LuckyRecord::PostgresURL.build( | |
hostname: "localhost", | |
database: database, | |
username: "ubuntu", | |
password: "password") | |
end | |
# In development and test, raise an error | |
# if you forget to preload associations | |
settings.lazy_load_enabled = Lucky::Env.production? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment