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
0d03b51c
Commit
0d03b51c
authored
May 23, 2016
by
James Sapara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaked how we load the database
parent
238eccbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
database.rb
config/database.rb
+1
-0
environment.rb
config/environment.rb
+4
-1
No files found.
config/database.rb
View file @
0d03b51c
...
@@ -17,6 +17,7 @@ configure do
...
@@ -17,6 +17,7 @@ configure do
}
}
# Production database settings, tuned for heroku
# Production database settings, tuned for heroku
when
:production
when
:production
# Configure from a DATABASE_URL environment variable
db
=
URI
.
parse
(
ENV
[
'DATABASE_URL'
])
# standard heroku environment variable for configuring the database
db
=
URI
.
parse
(
ENV
[
'DATABASE_URL'
])
# standard heroku environment variable for configuring the database
set
:database
,
{
set
:database
,
{
...
...
config/environment.rb
View file @
0d03b51c
...
@@ -9,7 +9,6 @@ require 'sinatra/activerecord'
...
@@ -9,7 +9,6 @@ require 'sinatra/activerecord'
require
'sinatra/contrib/all'
# Requires cookies, among other things
require
'sinatra/contrib/all'
# Requires cookies, among other things
ENV
[
'RACK_ENV'
]
||=
'development'
ENV
[
'RACK_ENV'
]
||=
'development'
APP_ROOT
=
Pathname
.
new
(
File
.
expand_path
(
'../../'
,
__FILE__
))
APP_ROOT
=
Pathname
.
new
(
File
.
expand_path
(
'../../'
,
__FILE__
))
APP_NAME
=
APP_ROOT
.
basename
.
to_s
APP_NAME
=
APP_ROOT
.
basename
.
to_s
...
@@ -31,6 +30,10 @@ configure :development, :test do
...
@@ -31,6 +30,10 @@ configure :development, :test do
require
'pry'
require
'pry'
end
end
# Production Sinatra Configuration
configure
:production
do
# NOOP
end
# Set up the database and models
# Set up the database and models
require
APP_ROOT
.
join
(
'config'
,
'database'
)
require
APP_ROOT
.
join
(
'config'
,
'database'
)
...
...
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