Commit 17c1629d by John Doe

moved to rails 5.1.1

parent b4364f2f
...@@ -2,7 +2,7 @@ source 'https://rubygems.org' ...@@ -2,7 +2,7 @@ source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.0.1' gem 'rails', '5.1.1'
# Use sqlite3 as the database for Active Record # Use sqlite3 as the database for Active Record
gem 'sqlite3' gem 'sqlite3'
# Use SCSS for stylesheets # Use SCSS for stylesheets
...@@ -10,7 +10,7 @@ gem 'sass-rails', '~> 5.0' ...@@ -10,7 +10,7 @@ gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets # Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0' gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views # Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0' # gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes # See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby # gem 'therubyracer', platforms: :ruby
......
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (5.0.1) actioncable (5.1.1)
actionpack (= 5.0.1) actionpack (= 5.1.1)
nio4r (~> 1.2) nio4r (~> 2.0)
websocket-driver (~> 0.6.1) websocket-driver (~> 0.6.1)
actionmailer (5.0.1) actionmailer (5.1.1)
actionpack (= 5.0.1) actionpack (= 5.1.1)
actionview (= 5.0.1) actionview (= 5.1.1)
activejob (= 5.0.1) activejob (= 5.1.1)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.0.1) actionpack (5.1.1)
actionview (= 5.0.1) actionview (= 5.1.1)
activesupport (= 5.0.1) activesupport (= 5.1.1)
rack (~> 2.0) rack (~> 2.0)
rack-test (~> 0.6.3) rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.1) actionview (5.1.1)
activesupport (= 5.0.1) activesupport (= 5.1.1)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.1) activejob (5.1.1)
activesupport (= 5.0.1) activesupport (= 5.1.1)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.0.1) activemodel (5.1.1)
activesupport (= 5.0.1) activesupport (= 5.1.1)
activerecord (5.0.1) activerecord (5.1.1)
activemodel (= 5.0.1) activemodel (= 5.1.1)
activesupport (= 5.0.1) activesupport (= 5.1.1)
arel (~> 7.0) arel (~> 8.0)
activesupport (5.0.1) activesupport (5.1.1)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7) i18n (~> 0.7)
minitest (~> 5.1) minitest (~> 5.1)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.5.0) addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2) public_suffix (~> 2.0, >= 2.0.2)
airbrussh (1.2.0) airbrussh (1.2.0)
sshkit (>= 1.6.1, != 1.7.0) sshkit (>= 1.6.1, != 1.7.0)
arel (7.1.4) arel (8.0.0)
ast (2.3.0) ast (2.3.0)
bcrypt (3.1.11) bcrypt (3.1.11)
bcrypt (3.1.11-x64-mingw32) bcrypt (3.1.11-x64-mingw32)
...@@ -66,7 +66,7 @@ GEM ...@@ -66,7 +66,7 @@ GEM
capistrano-rbenv (2.1.1) capistrano-rbenv (2.1.1)
capistrano (~> 3.1) capistrano (~> 3.1)
sshkit (~> 1.3) sshkit (~> 1.3)
capybara (2.12.0) capybara (2.14.0)
addressable addressable
mime-types (>= 1.16) mime-types (>= 1.16)
nokogiri (>= 1.3.3) nokogiri (>= 1.3.3)
...@@ -74,14 +74,7 @@ GEM ...@@ -74,14 +74,7 @@ GEM
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
xpath (~> 2.0) xpath (~> 2.0)
coderay (1.1.1) coderay (1.1.1)
coffee-rails (4.1.1) concurrent-ruby (1.0.5)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.4)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
cucumber (2.4.0) cucumber (2.4.0)
...@@ -94,44 +87,44 @@ GEM ...@@ -94,44 +87,44 @@ GEM
multi_test (>= 0.1.2) multi_test (>= 0.1.2)
cucumber-core (1.5.0) cucumber-core (1.5.0)
gherkin (~> 4.0) gherkin (~> 4.0)
cucumber-rails (1.4.5) cucumber-rails (1.5.0)
capybara (>= 1.1.2, < 3) capybara (>= 1.1.2, < 3)
cucumber (>= 1.3.8, < 4) cucumber (>= 1.3.8, < 4)
mime-types (>= 1.16, < 4) mime-types (>= 1.17, < 4)
nokogiri (~> 1.5) nokogiri (~> 1.5)
railties (>= 3, < 5.1) railties (>= 4, < 5.2)
cucumber-wire (0.0.1) cucumber-wire (0.0.1)
database_cleaner (1.5.3) database_cleaner (1.6.1)
debug_inspector (0.0.2) debug_inspector (0.0.3)
devise (4.2.0) devise (4.3.0)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.1) railties (>= 4.1.0, < 5.2)
responders responders
warden (~> 1.2.3) warden (~> 1.2.3)
devise_invitable (1.7.2) devise_invitable (1.7.2)
actionmailer (>= 4.1.0) actionmailer (>= 4.1.0)
devise (>= 4.0.0) devise (>= 4.0.0)
devise_token_auth (0.1.40) devise_token_auth (0.1.42)
devise (> 3.5.2, <= 4.2) devise (> 3.5.2, <= 4.3)
rails (< 6) rails (< 6)
diff-lcs (1.3) diff-lcs (1.3)
docile (1.1.5) docile (1.1.5)
erubis (2.7.0) erubi (1.6.0)
execjs (2.7.0) execjs (2.7.0)
factory_girl (4.8.0) factory_girl (4.8.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.8.0) factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0) factory_girl (~> 4.8.0)
railties (>= 3.0.0) railties (>= 3.0.0)
faker (1.7.2) faker (1.7.3)
i18n (~> 0.5) i18n (~> 0.5)
ffi (1.9.17) ffi (1.9.18)
ffi (1.9.17-x64-mingw32) ffi (1.9.18-x64-mingw32)
formatador (0.2.5) formatador (0.2.5)
gherkin (4.0.0) gherkin (4.1.3)
globalid (0.3.7) globalid (0.4.0)
activesupport (>= 4.1.0) activesupport (>= 4.2.0)
guard (2.14.1) guard (2.14.1)
formatador (>= 0.2.4) formatador (>= 0.2.4)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
...@@ -149,15 +142,15 @@ GEM ...@@ -149,15 +142,15 @@ GEM
guard-rubocop (1.2.0) guard-rubocop (1.2.0)
guard (~> 2.0) guard (~> 2.0)
rubocop (~> 0.20) rubocop (~> 0.20)
hashdiff (0.3.2) hashdiff (0.3.4)
hashie (3.5.5) hashie (3.5.5)
httparty (0.14.0) httparty (0.15.5)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (0.8.0) i18n (0.8.1)
jbuilder (2.6.1) jbuilder (2.6.4)
activesupport (>= 3.0.0, < 5.1) activesupport (>= 3.0.0)
multi_json (~> 1.2) multi_json (>= 1.2)
jquery-rails (4.2.2) jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3) rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
...@@ -168,15 +161,15 @@ GEM ...@@ -168,15 +161,15 @@ GEM
ruby_dep (~> 1.2) ruby_dep (~> 1.2)
loofah (2.0.3) loofah (2.0.3)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.11) lumberjack (1.0.12)
mail (2.6.4) mail (2.6.5)
mime-types (>= 1.16, < 4) mime-types (>= 1.16, < 4)
method_source (0.8.2) method_source (0.8.2)
mime-types (3.1) mime-types (3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2016.0521)
mini_portile2 (2.1.0) mini_portile2 (2.1.0)
minitest (5.10.1) minitest (5.10.2)
multi_json (1.12.1) multi_json (1.12.1)
multi_test (0.1.2) multi_test (0.1.2)
multi_xml (0.6.0) multi_xml (0.6.0)
...@@ -184,20 +177,20 @@ GEM ...@@ -184,20 +177,20 @@ GEM
net-scp (1.2.1) net-scp (1.2.1)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh (4.1.0) net-ssh (4.1.0)
nio4r (1.2.1) nio4r (2.0.0)
nokogiri (1.7.0.1) nokogiri (1.7.2)
mini_portile2 (~> 2.1.0) mini_portile2 (~> 2.1.0)
nokogiri (1.7.0.1-x64-mingw32) nokogiri (1.7.2-x64-mingw32)
mini_portile2 (~> 2.1.0) mini_portile2 (~> 2.1.0)
notiffany (0.1.1) notiffany (0.1.1)
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.0)
oj (2.18.1) oj (3.0.9)
omniauth (1.6.1) omniauth (1.6.1)
hashie (>= 3.4.6, < 3.6.0) hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
orm_adapter (0.5.0) orm_adapter (0.5.0)
parser (2.3.3.1) parser (2.4.0.0)
ast (~> 2.2) ast (~> 2.2)
powerpack (0.1.1) powerpack (0.1.1)
pry (0.10.4) pry (0.10.4)
...@@ -205,64 +198,66 @@ GEM ...@@ -205,64 +198,66 @@ GEM
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
public_suffix (2.0.5) public_suffix (2.0.5)
rack (2.0.1) rack (2.0.3)
rack-cors (0.4.1) rack-cors (0.4.1)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (5.0.1) rails (5.1.1)
actioncable (= 5.0.1) actioncable (= 5.1.1)
actionmailer (= 5.0.1) actionmailer (= 5.1.1)
actionpack (= 5.0.1) actionpack (= 5.1.1)
actionview (= 5.0.1) actionview (= 5.1.1)
activejob (= 5.0.1) activejob (= 5.1.1)
activemodel (= 5.0.1) activemodel (= 5.1.1)
activerecord (= 5.0.1) activerecord (= 5.1.1)
activesupport (= 5.0.1) activesupport (= 5.1.1)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0, < 2.0)
railties (= 5.0.1) railties (= 5.1.1)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.2) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0, < 6.0) activesupport (>= 4.2.0)
nokogiri (~> 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3) rails-html-sanitizer (1.0.3)
loofah (~> 2.0) loofah (~> 2.0)
railties (5.0.1) railties (5.1.1)
actionpack (= 5.0.1) actionpack (= 5.1.1)
activesupport (= 5.0.1) activesupport (= 5.1.1)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (2.2.1) rainbow (2.2.2)
rake
rake (12.0.0) rake (12.0.0)
rb-fsevent (0.9.8) rb-fsevent (0.9.8)
rb-inotify (0.9.8) rb-inotify (0.9.8)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rdoc (4.3.0) rdoc (4.3.0)
responders (2.3.0) responders (2.4.0)
railties (>= 4.2.0, < 5.1) actionpack (>= 4.2.0, < 5.3)
rspec (3.5.0) railties (>= 4.2.0, < 5.3)
rspec-core (~> 3.5.0) rspec (3.6.0)
rspec-expectations (~> 3.5.0) rspec-core (~> 3.6.0)
rspec-mocks (~> 3.5.0) rspec-expectations (~> 3.6.0)
rspec-core (3.5.4) rspec-mocks (~> 3.6.0)
rspec-support (~> 3.5.0) rspec-core (3.6.0)
rspec-expectations (3.5.0) rspec-support (~> 3.6.0)
rspec-expectations (3.6.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0) rspec-support (~> 3.6.0)
rspec-json_expectations (2.1.0) rspec-json_expectations (2.1.0)
rspec-mocks (3.5.0) rspec-mocks (3.6.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0) rspec-support (~> 3.6.0)
rspec-rails (3.5.2) rspec-rails (3.6.0)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (>= 3.0) railties (>= 3.0)
rspec-core (~> 3.5.0) rspec-core (~> 3.6.0)
rspec-expectations (~> 3.5.0) rspec-expectations (~> 3.6.0)
rspec-mocks (~> 3.5.0) rspec-mocks (~> 3.6.0)
rspec-support (~> 3.5.0) rspec-support (~> 3.6.0)
rspec-support (3.5.0) rspec-support (3.6.0)
rubocop (0.47.1) rubocop (0.48.1)
parser (>= 2.3.3.1, < 3.0) parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1) powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
...@@ -271,7 +266,7 @@ GEM ...@@ -271,7 +266,7 @@ GEM
ruby-progressbar (1.8.1) ruby-progressbar (1.8.1)
ruby_dep (1.5.0) ruby_dep (1.5.0)
safe_yaml (1.0.4) safe_yaml (1.0.4)
sass (3.4.23) sass (3.4.24)
sass-rails (5.0.6) sass-rails (5.0.6)
railties (>= 4.0.0, < 6) railties (>= 4.0.0, < 6)
sass (~> 3.1) sass (~> 3.1)
...@@ -282,11 +277,11 @@ GEM ...@@ -282,11 +277,11 @@ GEM
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0) rdoc (~> 4.0)
shellany (0.0.1) shellany (0.0.1)
simplecov (0.13.0) simplecov (0.14.1)
docile (~> 1.1.0) docile (~> 1.1.0)
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
simplecov-html (0.10.0) simplecov-html (0.10.1)
slop (3.6.0) slop (3.6.0)
spring (2.0.1) spring (2.0.1)
activesupport (>= 4.2) activesupport (>= 4.2)
...@@ -304,21 +299,21 @@ GEM ...@@ -304,21 +299,21 @@ GEM
sshkit (1.13.1) sshkit (1.13.1)
net-scp (>= 1.1.2) net-scp (>= 1.1.2)
net-ssh (>= 2.8.0) net-ssh (>= 2.8.0)
terminal-notifier (1.7.1) terminal-notifier (1.8.0)
terminal-notifier-guard (1.7.0) terminal-notifier-guard (1.7.0)
thor (0.19.4) thor (0.19.4)
thread_safe (0.3.5) thread_safe (0.3.6)
tilt (2.0.6) tilt (2.0.7)
turbolinks (5.0.1) turbolinks (5.0.1)
turbolinks-source (~> 5) turbolinks-source (~> 5)
turbolinks-source (5.0.0) turbolinks-source (5.0.3)
tzinfo (1.2.2) tzinfo (1.2.3)
thread_safe (~> 0.1) thread_safe (~> 0.1)
tzinfo-data (1.2016.10) tzinfo-data (1.2017.2)
tzinfo (>= 1.0.0) tzinfo (>= 1.0.0)
uglifier (3.0.4) uglifier (3.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.3) unicode-display_width (1.2.1)
vcr (3.0.3) vcr (3.0.3)
warden (1.2.7) warden (1.2.7)
rack (>= 1.0) rack (>= 1.0)
...@@ -327,7 +322,7 @@ GEM ...@@ -327,7 +322,7 @@ GEM
binding_of_caller (>= 0.7.2) binding_of_caller (>= 0.7.2)
railties (>= 4.0) railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
webmock (2.3.2) webmock (3.0.1)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff hashdiff
...@@ -347,7 +342,6 @@ DEPENDENCIES ...@@ -347,7 +342,6 @@ DEPENDENCIES
capistrano-passenger capistrano-passenger
capistrano-rails (~> 1.2) capistrano-rails (~> 1.2)
capistrano-rbenv (~> 2.0) capistrano-rbenv (~> 2.0)
coffee-rails (~> 4.1.0)
cucumber-rails cucumber-rails
database_cleaner database_cleaner
devise_invitable devise_invitable
...@@ -363,7 +357,7 @@ DEPENDENCIES ...@@ -363,7 +357,7 @@ DEPENDENCIES
oj oj
omniauth omniauth
rack-cors rack-cors
rails (= 5.0.1) rails (= 5.1.1)
rspec-json_expectations rspec-json_expectations
rspec-rails (~> 3.1) rspec-rails (~> 3.1)
rubocop rubocop
......
...@@ -18,6 +18,7 @@ chdir APP_ROOT do ...@@ -18,6 +18,7 @@ chdir APP_ROOT do
system! 'gem install bundler --conservative' system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install') system('bundle check') || system!('bundle install')
# puts "\n== Copying sample files ==" # puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml') # unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml' # cp 'config/database.yml.sample', 'config/database.yml'
......
require_relative 'boot' require_relative 'boot'
require 'rails/all' require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
# require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
# require "action_cable/engine"
# require "sprockets/railtie"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems # Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
...@@ -8,9 +18,16 @@ Bundler.require(*Rails.groups) ...@@ -8,9 +18,16 @@ Bundler.require(*Rails.groups)
module ControlPanel module ControlPanel
class Application < Rails::Application class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers # Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded. # -- all .rb files in that directory are automatically loaded.
# Only loads a smaller set of middleware suitable for API only apps.
# Middleware like session, flash, cookies can be added back manually.
# Skip views, helpers and assets when generating a new resource.
config.api_only = true config.api_only = true
# Add folders under the services and adapters directory # Add folders under the services and adapters directory
%w(data nilm db db_folder db_stream permission user_group user data_view).each do |service| %w(data nilm db db_folder db_stream permission user_group user data_view).each do |service|
......
...@@ -7,3 +7,4 @@ test: ...@@ -7,3 +7,4 @@ test:
production: production:
adapter: redis adapter: redis
url: redis://localhost:6379/1 url: redis://localhost:6379/1
channel_prefix: control_panel_production
...@@ -18,7 +18,7 @@ Rails.application.configure do ...@@ -18,7 +18,7 @@ Rails.application.configure do
config.cache_store = :memory_store config.cache_store = :memory_store
config.public_file_server.headers = { config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800' 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
} }
else else
config.action_controller.perform_caching = false config.action_controller.perform_caching = false
......
...@@ -15,7 +15,7 @@ Rails.application.configure do ...@@ -15,7 +15,7 @@ Rails.application.configure do
# Configure public file server for tests with Cache-Control for performance. # Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true config.public_file_server.enabled = true
config.public_file_server.headers = { config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=3600' 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
} }
# Show full error reports and disable caching. # Show full error reports and disable caching.
......
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
# Version of your assets, change this if you want to expire all your assets. # Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0' Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path # Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path # Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets. # Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # application.js, application.css, and all non-JS/CSS in the app/assets
# Rails.application.config.assets.precompile += %w( search.js ) # folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
...@@ -16,6 +16,16 @@ ...@@ -16,6 +16,16 @@
# #
# This would use the information in config/locales/es.yml. # This would use the information in config/locales/es.yml.
# #
# The following keys must be escaped otherwise they will not be retrieved by
# the default I18n backend:
#
# true, false, on, off, yes, no
#
# Instead, surround them with single quotes.
#
# en:
# 'true': 'foo'
#
# To learn more, please read the Rails Internationalization guide # To learn more, please read the Rails Internationalization guide
# available at http://guides.rubyonrails.org/i18n.html. # available at http://guides.rubyonrails.org/i18n.html.
......
# Puma can serve each request in a thread from an internal thread pool. # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum. # The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match # Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum # the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record. # and maximum; this matches the default thread size of Active Record.
# #
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
# #
port ENV.fetch("PORT") { 3000 } port ENV.fetch("PORT") { 3000 }
...@@ -32,16 +32,25 @@ environment ENV.fetch("RAILS_ENV") { "development" } ...@@ -32,16 +32,25 @@ environment ENV.fetch("RAILS_ENV") { "development" }
# #
# preload_app! # preload_app!
# If you are preloading your application and using Active Record, it's
# recommended that you close any connections to the database before workers
# are forked to prevent connection leakage.
#
# before_fork do
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
# end
# The code in the `on_worker_boot` will be called if you are using # The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker # clustered mode by specifying a number of `workers`. After each worker
# process is booted this block will be run, if you are using `preload_app!` # process is booted, this block will be run. If you are using the `preload_app!`
# option you will want to use this block to reconnect to any threads # option, you will want to use this block to reconnect to any threads
# or connections that may have been created at application boot, Ruby # or connections that may have been created at application boot, as Ruby
# cannot share connections between processes. # cannot share connections between processes.
# #
# on_worker_boot do # on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end # end
#
# Allow puma to be restarted by `rails restart` command. # Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart plugin :tmp_restart
...@@ -10,13 +10,23 @@ ...@@ -10,13 +10,23 @@
# Make sure the secrets in this file are kept private # Make sure the secrets in this file are kept private
# if you're sharing your code publicly. # if you're sharing your code publicly.
# Shared secrets are available across all environments.
# shared:
# api_key: a1B2c3D4e5F6
# Environmental secrets are only available for that specific environment.
development: development:
secret_key_base: fab2042587cdf751633b04a5b9ee9d35b6e3f7e6d58072dbf7522943b41b7ec38485a0dd393727e9f8a99cec0c0c38e846d21e9eaf4def9e585ca7c599750086 secret_key_base: 5378da95ac37be4d4bab4010596a835b639e01dd084ea37e151bf05fc5dec0c6f46f1b162e9325121d757a4683df9880819ba269f488f93a647c935f9b1453d0
test: test:
secret_key_base: 54f457fa59508035f7b585741602a1a674b98dd52f7e7365cfd599381d48a95c1b27e8ab397dc7dbaf2fa34a8cb7c1f970b59ec7fff0c9a080c6a3ba4a68cf66 secret_key_base: 4bb907a33b2b802d006591923f59fa1d0c355f0005dea53efee24b842b17b6b2addd264b20d2d51283c7a0d291efe6888cd1c7e1959f07ccb56304a713696b1e
# Do not keep production secrets in the unencrypted secrets file.
# Instead, either read values from the environment.
# Or, use `bin/rails secrets:setup` to configure encrypted secrets
# and move the `production:` environment over there.
# Do not keep production secrets in the repository,
# instead read values from the environment.
production: production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment