Skip to content

Instantly share code, notes, and snippets.

@9876691
Created September 7, 2018 13:58
Show Gist options
  • Save 9876691/69a4024c51d5820048fce0d201538568 to your computer and use it in GitHub Desktop.
Save 9876691/69a4024c51d5820048fce0d201538568 to your computer and use it in GitHub Desktop.
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