Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sinatra-skeleton
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Ernesto Suarez
sinatra-skeleton
Commits
31b73b6b
Commit
31b73b6b
authored
May 25, 2016
by
Vaz Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatic db config in production from DATABASE_URL
parent
74898c05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
database.rb
config/database.rb
+4
-10
No files found.
config/database.rb
View file @
31b73b6b
...
...
@@ -11,16 +11,10 @@ configure :development, :test do
end
configure
:production
do
db
=
URI
.
parse
(
ENV
[
'DATABASE_URL'
])
# standard heroku environment variable for configuring the database
set
:database
,
{
:adapter
=>
db
.
scheme
==
'postgres'
?
'postgresql'
:
db
.
scheme
,
:host
=>
db
.
host
,
:username
=>
db
.
user
,
:password
=>
db
.
password
,
:database
=>
db
.
path
[
1
..-
1
],
:encoding
=>
'utf8'
}
# Database connection is configured automatically based on the DATABASE_URL
# environment variable. This is a feature of sinatra/activerecord support.
#
# If you're deploying to Heroku this will be set automatically.
end
configure
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment