Skip to content

Commit 89b1870

Browse files
committed
Remove sqlite and 12 factor
* https://github.com/heroku/rails_12factor#rails-5 says 12 factor not needed for heroku * Sqlite crashing on tests
1 parent f105b36 commit 89b1870

File tree

6 files changed

+43
-61
lines changed

6 files changed

+43
-61
lines changed

Gemfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@ gem "rails"
77
gem "listen"
88

99
# Note: We're using sqllite3 for development and testing
10-
gem "sqlite3", group: [:development, :test]
10+
# gem "sqlite3", group: [:development, :test]
1111

12-
group :production do
13-
# Pg is used for Heroku
14-
gem "pg"
15-
gem "rails_12factor" # Never include this for development or tests
16-
end
12+
gem "pg"
1713

1814
gem "puma"
1915

Gemfile.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,6 @@ GEM
187187
nokogiri (~> 1.6.0)
188188
rails-html-sanitizer (1.0.3)
189189
loofah (~> 2.0)
190-
rails_12factor (0.0.3)
191-
rails_serve_static_assets
192-
rails_stdout_logging
193-
rails_serve_static_assets (0.0.5)
194-
rails_stdout_logging (0.0.5)
195190
railties (5.0.0.1)
196191
actionpack (= 5.0.0.1)
197192
activesupport (= 5.0.0.1)
@@ -276,7 +271,6 @@ GEM
276271
actionpack (>= 4.0)
277272
activesupport (>= 4.0)
278273
sprockets (>= 3.0.0)
279-
sqlite3 (1.3.12)
280274
term-ansicolor (1.4.0)
281275
tins (~> 1.0)
282276
thor (0.19.1)
@@ -334,7 +328,6 @@ DEPENDENCIES
334328
puma
335329
rails
336330
rails-html-sanitizer
337-
rails_12factor
338331
rainbow
339332
react_on_rails (~> 6.1)
340333
rspec-rails (~> 3)
@@ -347,7 +340,6 @@ DEPENDENCIES
347340
selenium-webdriver (< 3.0.0)
348341
spring
349342
spring-commands-rspec
350-
sqlite3
351343
uglifier
352344
web-console
353345

config/database.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,43 @@
55
# gem "sqlite3"
66
#
77
# NOTE: Real world apps would not have a different DB for development
8-
default: &default
9-
adapter: sqlite3
10-
pool: 5
11-
timeout: 5000
12-
13-
development:
14-
<<: *default
15-
database: db/development.sqlite3
16-
17-
# Warning: The database defined as "test" will be erased and
18-
# re-generated from your development database when you run "rake".
19-
# Do not set this db to the same as development or production.
20-
test:
21-
<<: *default
22-
database: db/test.sqlite3
23-
24-
production:
25-
<<: *default
26-
database: db/production.sqlite3
27-
28-
# Uncomment below for a setup with just postgres and change your Gemfile to reflect this
29-
# default: &default
30-
# adapter: postgresql
31-
# username:
32-
# password:
8+
#default: &default
9+
# adapter: sqlite3
10+
# pool: 5
11+
# timeout: 5000
3312
#
34-
# development:
35-
# <<: *default
36-
# database: tutorial_development
13+
#development:
14+
# <<: *default
15+
# database: db/development.sqlite3
3716
#
38-
# # Warning: The database defined as "test" will be erased and
39-
# # re-generated from your development database when you run "rake".
40-
# # Do not set this db to the same as development or production.
41-
# test:
42-
# <<: *default
43-
# database: tutorial_test
17+
## Warning: The database defined as "test" will be erased and
18+
## re-generated from your development database when you run "rake".
19+
## Do not set this db to the same as development or production.
20+
#test:
21+
# <<: *default
22+
# database: db/test.sqlite3
4423
#
4524
#production:
4625
# <<: *default
47-
# database: tutorial_production
26+
# database: db/production.sqlite3
27+
28+
# Uncomment below for a setup with just postgres and change your Gemfile to reflect this
29+
default: &default
30+
adapter: postgresql
31+
username:
32+
password:
33+
34+
development:
35+
<<: *default
36+
database: react_webpack_dev
37+
38+
# Warning: The database defined as "test" will be erased and
39+
# re-generated from your development database when you run "rake".
40+
# Do not set this db to the same as development or production.
41+
test:
42+
<<: *default
43+
database: react_webpack_test
44+
45+
production:
46+
<<: *default
47+
database: react_webpack_dev

config/environments/production.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
5858

5959
if ENV["RAILS_LOG_TO_STDOUT"].present?
60-
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
60+
logger = ActiveSupport::Logger.new(STDOUT)
61+
logger.formatter = config.log_formatter
62+
config.logger = ActiveSupport::TaggedLogging.new(logger)
6163
end
6264

6365
# Use a different cache store in production.

db/schema.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# encoding: UTF-8
21
# This file is auto-generated from the current state of the database. Instead
32
# of editing this file, please use the migrations feature of Active Record to
43
# incrementally modify your database, and then regenerate this schema definition.
@@ -13,6 +12,9 @@
1312

1413
ActiveRecord::Schema.define(version: 20151015160334) do
1514

15+
# These are extensions that must be enabled in order to support this database
16+
enable_extension "plpgsql"
17+
1618
create_table "comments", force: :cascade do |t|
1719
t.string "author", default: "", null: false
1820
t.text "text", default: "", null: false

spec/rails_helper.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,3 @@ def js_selenium_driver
146146
driver
147147
end
148148
end
149-
150-
# trying to fix the deadlocks in sqlite for testing
151-
class ActiveRecord::Base
152-
mattr_accessor :shared_connection
153-
@@shared_connection = nil
154-
def self.connection
155-
@@shared_connection || retrieve_connection
156-
end
157-
end
158-
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection

0 commit comments

Comments
 (0)