From 3f8cd8803af5aa6913f7851b3bd127a6bc4f6bd6 Mon Sep 17 00:00:00 2001 From: phil Date: Wed, 18 Mar 2015 16:33:58 +0100 Subject: [PATCH] upgrade rails from 4.0.13 to 4.2.0 --- .ruby-version | 2 +- Gemfile | 26 +- Gemfile.lock | 348 ++++++++++-------- Rakefile | 2 +- app/assets/javascripts/active_admin.js.coffee | 4 +- app/assets/stylesheets/active_admin.css.scss | 4 +- app/assets/stylesheets/application.css | 2 +- bin/rails | 4 + bin/rake | 4 + bin/setup | 29 ++ bin/spring | 15 + config/application.rb | 3 + config/boot.rb | 3 +- config/environment.rb | 2 +- config/environments/development.rb | 13 +- config/environments/production.rb | 13 +- config/environments/test.rb | 7 +- config/initializers/assets.rb | 11 + config/initializers/cookies_serializer.rb | 3 + config/initializers/mime_types.rb | 1 - config/initializers/secret_token.rb | 12 - config/initializers/session_store.rb | 2 +- config/routes.rb | 2 +- config/secrets.yml | 22 ++ 24 files changed, 335 insertions(+), 199 deletions(-) create mode 100644 bin/setup create mode 100755 bin/spring create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/cookies_serializer.rb delete mode 100644 config/initializers/secret_token.rb create mode 100644 config/secrets.yml diff --git a/.ruby-version b/.ruby-version index c82eec7..eca07e4 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -1.9.3-p448 +2.1.2 diff --git a/Gemfile b/Gemfile index 577db83..8af76cd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,33 +1,32 @@ source 'https://rubygems.org' -gem 'rails', '4.0.13' +gem 'rails', '4.2.0' gem 'pg' -gem 'sass-rails', '~> 4.0.2' +gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' -gem 'coffee-rails', '~> 4.0.0' +gem 'coffee-rails', '~> 4.1.0' gem 'haml-rails' gem 'therubyracer', platforms: :ruby gem 'jquery-rails' gem 'jquery-ui-rails' gem 'turbolinks' -gem 'jbuilder', '~> 1.2' -gem 'delayed_job' -gem 'delayed_job_active_record' +gem 'jbuilder', '~> 2.0' +gem 'delayed_job', '~> 4.0.6' +gem 'delayed_job_active_record', '~> 4.0.3' gem "highcharts-rails", "~> 3.0.0" gem 'd3_rails' # remember to update app/assets/javascripts/private_pub.js when # updating private_pub gem! # see https://github.com/munen/voicerepublic_backoffice/commit/ca0b016e01481bd500 gem 'private_pub' +gem 'devise' -group :doc do - gem 'sdoc', require: false -end +gem 'sdoc', '~> 0.4.0', group: :doc # gem 'bcrypt', '~> 3.1.7' gem 'unicorn' -gem 'activeadmin', github: 'gregbell/active_admin' +gem 'activeadmin', github: 'activeadmin/activeadmin' gem 'airbrake' gem 'rails_config' gem 'activeadmin-dragonfly', github: 'stefanoverna/activeadmin-dragonfly' @@ -42,8 +41,9 @@ group :development do end group :development, :test do - gem 'zeus' + gem 'spring' + gem 'web-console', '~> 2.0' gem 'pry-rails' - gem 'debugger' - gem 'disable_assets_logger' + gem 'byebug' + #gem 'disable_assets_logger' end diff --git a/Gemfile.lock b/Gemfile.lock index ec6c9cc..9fe7933 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,24 +1,24 @@ GIT - remote: git://github.com/gregbell/active_admin.git - revision: 60d8be97ec2c29a871f55bd28e00ca9ec9257028 + remote: git://github.com/activeadmin/activeadmin.git + revision: e3a7354c0196743e2462bdc27c591e8285d110b0 specs: - activeadmin (1.0.0.pre) - arbre (~> 1.0) + activeadmin (1.0.0.pre1) + arbre (~> 1.0, >= 1.0.2) bourbon coffee-rails - devise (~> 3.2) - formtastic (~> 2.3.0.rc2) - inherited_resources (~> 1.3) + formtastic (~> 3.1) + formtastic_i18n + inherited_resources (~> 1.6) jquery-rails - jquery-ui-rails + jquery-ui-rails (~> 5.0) kaminari (~> 0.15) - rails (>= 3.2, < 4.1) - ransack (~> 1.0) + rails (>= 3.2, < 5.0) + ransack (~> 1.3) sass-rails GIT remote: git://github.com/stefanoverna/activeadmin-dragonfly.git - revision: 89a47f9124b1c4ee4ae79f6c32aa999d2566c5d1 + revision: 611164ff0255c66a3e555b5d46dd99f0eff1f115 specs: activeadmin-dragonfly (0.0.2) activeadmin @@ -28,89 +28,100 @@ GIT GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.13) - actionpack (= 4.0.13) + actionmailer (4.2.0) + actionpack (= 4.2.0) + actionview (= 4.2.0) + activejob (= 4.2.0) mail (~> 2.5, >= 2.5.4) - actionpack (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.0) + actionview (= 4.2.0) + activesupport (= 4.2.0) + rack (~> 1.6.0) rack-test (~> 0.6.2) - activemodel (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - activerecord (4.0.13) - activemodel (= 4.0.13) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.13) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.13) - i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + actionview (4.2.0) + activesupport (= 4.2.0) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + activejob (4.2.0) + activesupport (= 4.2.0) + globalid (>= 0.3.0) + activemodel (4.2.0) + activesupport (= 4.2.0) + builder (~> 3.1) + activerecord (4.2.0) + activemodel (= 4.2.0) + activesupport (= 4.2.0) + arel (~> 6.0) + activesupport (4.2.0) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) acts-as-taggable-on (3.0.1) rails (>= 3, < 5) - addressable (2.3.6) - airbrake (3.1.15) + addressable (2.3.7) + airbrake (4.1.0) builder multi_json annotator (0.0.10) activerecord (>= 3.0) - arbre (1.0.1) + arbre (1.0.3) activesupport (>= 3.0.0) - arel (4.0.2) - bcrypt-ruby (3.1.2) - bourbon (3.1.8) - sass (>= 3.2.0) + arel (6.0.0) + bcrypt (3.1.10) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + bourbon (4.2.1) + sass (~> 3.4) thor - builder (3.1.4) + builder (3.2.2) + byebug (4.0.2) + columnize (= 0.9.0) capistrano (3.1.0) i18n rake (>= 10.0.0) sshkit (~> 1.3) - capistrano-bundler (1.1.1) - capistrano (~> 3.0) - sshkit (>= 1.2.0) - capistrano-rails (1.1.1) + capistrano-bundler (1.1.4) + capistrano (~> 3.1) + sshkit (~> 1.2) + capistrano-rails (1.1.2) capistrano (~> 3.1) capistrano-bundler (~> 1.1) - capistrano-rbenv (2.0.2) + capistrano-rbenv (2.0.3) capistrano (~> 3.1) sshkit (~> 1.3) coderay (1.1.0) - coffee-rails (4.0.1) + coffee-rails (4.1.0) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) - coffee-script (2.2.0) + coffee-script (2.3.0) coffee-script-source execjs - coffee-script-source (1.7.0) - columnize (0.3.6) + coffee-script-source (1.9.1) + colorize (0.7.5) + columnize (0.9.0) cookiejar (0.3.2) - d3_rails (3.4.6) + d3_rails (3.5.5) railties (>= 3.1.0) - debugger (1.6.5) - columnize (>= 0.3.1) - debugger-linecache (~> 1.2.0) - debugger-ruby_core_source (~> 1.3.1) - debugger-linecache (1.2.0) - debugger-ruby_core_source (1.3.1) - delayed_job (4.0.0) - activesupport (>= 3.0, < 4.1) - delayed_job_active_record (4.0.0) - activerecord (>= 3.0, < 4.1) + debug_inspector (0.0.2) + delayed_job (4.0.6) + activesupport (>= 3.0, < 5.0) + delayed_job_active_record (4.0.3) + activerecord (>= 3.0, < 5.0) delayed_job (>= 3.0, < 4.1) - devise (3.2.2) - bcrypt-ruby (~> 3.0) + devise (3.4.1) + bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) + responders thread_safe (~> 0.1) warden (~> 1.2.3) - disable_assets_logger (1.0.0) dragonfly (0.9.15) multi_json (~> 1.0) rack @@ -123,115 +134,150 @@ GEM em-socksify (0.3.0) eventmachine (>= 1.0.0.beta.4) erubis (2.7.0) - eventmachine (1.0.3) - execjs (2.0.2) - faye (1.0.1) + eventmachine (1.0.7) + execjs (2.4.0) + faye (1.1.1) cookiejar (>= 0.3.0) em-http-request (>= 0.3.0) eventmachine (>= 0.12.0) - faye-websocket (>= 0.7.0) + faye-websocket (>= 0.9.1) multi_json (>= 1.0.0) rack (>= 1.0.0) - websocket-driver (>= 0.3.0) - faye-websocket (0.7.3) + websocket-driver (>= 0.5.1) + faye-websocket (0.9.2) eventmachine (>= 0.12.0) - websocket-driver (>= 0.3.1) - formtastic (2.3.0.rc2) - actionpack (>= 3.0) - haml (4.0.5) + websocket-driver (>= 0.5.1) + formtastic (3.1.3) + actionpack (>= 3.2.13) + formtastic_i18n (0.2.0) + globalid (0.3.3) + activesupport (>= 4.1.0) + haml (4.0.6) tilt - haml-rails (0.5.3) + haml-rails (0.9.0) actionpack (>= 4.0.1) activesupport (>= 4.0.1) - haml (>= 3.1, < 5.0) + haml (>= 4.0.6, < 5.0) + html2haml (>= 1.0.1) railties (>= 4.0.1) - has_scope (0.6.0.rc) + has_scope (0.6.0) actionpack (>= 3.2, < 5) activesupport (>= 3.2, < 5) highcharts-rails (3.0.10) railties (>= 3.1) hike (1.2.3) + html2haml (2.0.0) + erubis (~> 2.7.0) + haml (~> 4.0.0) + nokogiri (~> 1.6.0) + ruby_parser (~> 3.5) http_parser.rb (0.6.0) i18n (0.7.0) - inherited_resources (1.4.1) + inherited_resources (1.6.0) + actionpack (>= 3.2, < 5) has_scope (~> 0.6.0.rc) - responders (~> 1.0.0.rc) - jbuilder (1.5.3) - activesupport (>= 3.0.0) - multi_json (>= 1.2.0) - jquery-rails (3.1.0) - railties (>= 3.0, < 5.0) + railties (>= 3.2, < 5) + responders + jbuilder (2.2.11) + activesupport (>= 3.0.0, < 5) + multi_json (~> 1.2) + jquery-rails (4.0.3) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (4.1.1) - railties (>= 3.1.0) - json (1.8.1) - kaminari (0.15.1) + jquery-ui-rails (5.0.3) + railties (>= 3.2.16) + json (1.8.2) + kaminari (0.16.3) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - kgio (2.9.0) - libv8 (3.16.14.3) + kgio (2.9.3) + libv8 (3.16.14.7) + loofah (2.0.1) + nokogiri (>= 1.5.9) mail (2.6.3) mime-types (>= 1.16, < 3) method_source (0.8.2) mime-types (2.4.3) - minitest (4.7.5) + mini_portile (0.6.2) + minitest (5.5.1) multi_json (1.11.0) - net-scp (1.1.2) + net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (2.8.0) + net-ssh (2.9.2) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) orm_adapter (0.5.0) - pg (0.17.1) - polyamorous (0.6.4) + pg (0.18.1) + polyamorous (1.1.0) activerecord (>= 3.0) private_pub (1.0.3) faye - pry (0.9.12.6) - coderay (~> 1.0) - method_source (~> 0.8) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) slop (~> 3.4) - pry-rails (0.3.2) + pry-rails (0.3.3) pry (>= 0.9.10) - rack (1.5.2) + rack (1.6.0) rack-cache (1.2) rack (>= 0.4) rack-test (0.6.3) rack (>= 1.0) - rails (4.0.13) - actionmailer (= 4.0.13) - actionpack (= 4.0.13) - activerecord (= 4.0.13) - activesupport (= 4.0.13) + rails (4.2.0) + actionmailer (= 4.2.0) + actionpack (= 4.2.0) + actionview (= 4.2.0) + activejob (= 4.2.0) + activemodel (= 4.2.0) + activerecord (= 4.2.0) + activesupport (= 4.2.0) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.13) - sprockets-rails (~> 2.0) - rails_config (0.3.3) + railties (= 4.2.0) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.6) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.2) + loofah (~> 2.0) + rails_config (0.4.2) activesupport (>= 3.0) - railties (4.0.13) - actionpack (= 4.0.13) - activesupport (= 4.0.13) + railties (4.2.0) + actionpack (= 4.2.0) + activesupport (= 4.2.0) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - raindrops (0.12.0) + raindrops (0.13.0) rake (10.4.2) - ransack (1.1.0) + ransack (1.6.3) actionpack (>= 3.0) activerecord (>= 3.0) - polyamorous (~> 0.6.0) - rdoc (4.1.1) + activesupport (>= 3.0) + i18n + polyamorous (~> 1.1) + rdoc (4.2.0) json (~> 1.4) ref (1.0.5) - responders (1.0.0) - railties (>= 3.2, < 5) - sass (3.2.19) - sass-rails (4.0.5) + responders (2.1.0) + railties (>= 4.2.0, < 5) + ruby_parser (3.6.5) + sexp_processor (~> 4.1) + sass (3.4.13) + sass-rails (5.0.1) railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) - sdoc (0.4.0) - json (~> 1.8) - rdoc (~> 4.0, < 5.0) - slop (3.4.7) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (~> 1.1) + sdoc (0.4.1) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) + sexp_processor (4.5.0) + slop (3.6.0) + spring (1.3.3) sprockets (2.12.3) hike (~> 1.2) multi_json (~> 1.0) @@ -241,34 +287,37 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) - sshkit (1.3.0) + sshkit (1.7.1) + colorize (>= 0.7.0) net-scp (>= 1.1.2) - net-ssh - term-ansicolor - term-ansicolor (1.2.2) - tins (~> 0.8) + net-ssh (>= 2.8.0) therubyracer (0.12.1) libv8 (~> 3.16.14.0) ref thor (0.19.1) thread_safe (0.3.5) tilt (1.4.1) - tins (0.13.2) - turbolinks (2.2.1) + turbolinks (2.5.3) coffee-rails - tzinfo (0.3.43) - uglifier (2.4.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.7.1) execjs (>= 0.3.0) json (>= 1.8.0) - unicorn (4.8.1) + unicorn (4.8.3) kgio (~> 2.6) rack raindrops (~> 0.7) warden (1.2.3) rack (>= 1.0) - websocket-driver (0.3.3) - zeus (0.13.3) - method_source (>= 0.6.7) + web-console (2.1.2) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + websocket-driver (0.5.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) PLATFORMS ruby @@ -279,30 +328,31 @@ DEPENDENCIES acts-as-taggable-on (= 3.0.1) airbrake annotator + byebug capistrano (~> 3.1.0) capistrano-bundler (~> 1.1.1) capistrano-rails (~> 1.1.1) capistrano-rbenv (~> 2.0.1) - coffee-rails (~> 4.0.0) + coffee-rails (~> 4.1.0) d3_rails - debugger - delayed_job - delayed_job_active_record - disable_assets_logger + delayed_job (~> 4.0.6) + delayed_job_active_record (~> 4.0.3) + devise haml-rails highcharts-rails (~> 3.0.0) - jbuilder (~> 1.2) + jbuilder (~> 2.0) jquery-rails jquery-ui-rails pg private_pub pry-rails - rails (= 4.0.13) + rails (= 4.2.0) rails_config - sass-rails (~> 4.0.2) - sdoc + sass-rails (~> 5.0) + sdoc (~> 0.4.0) + spring therubyracer turbolinks uglifier (>= 1.3.0) unicorn - zeus + web-console (~> 2.0) diff --git a/Rakefile b/Rakefile index 960881d..ba6b733 100644 --- a/Rakefile +++ b/Rakefile @@ -3,4 +3,4 @@ require File.expand_path('../config/application', __FILE__) -VoicerepublicBackoffice::Application.load_tasks +Rails.application.load_tasks diff --git a/app/assets/javascripts/active_admin.js.coffee b/app/assets/javascripts/active_admin.js.coffee index 062937f..3fc8233 100644 --- a/app/assets/javascripts/active_admin.js.coffee +++ b/app/assets/javascripts/active_admin.js.coffee @@ -1,7 +1,7 @@ #= require active_admin/base # -#= require jquery.ui.datepicker -#= require jquery.ui.slider +#= require jquery-ui/datepicker +#= require jquery-ui/slider #= require jquery-ui-timepicker-addon #= require datepicker #= require highcharts diff --git a/app/assets/stylesheets/active_admin.css.scss b/app/assets/stylesheets/active_admin.css.scss index 4366506..c4572c2 100644 --- a/app/assets/stylesheets/active_admin.css.scss +++ b/app/assets/stylesheets/active_admin.css.scss @@ -16,8 +16,8 @@ // // .status_tag { background: #6090DB; } -@import 'jquery.ui.datepicker'; -@import 'jquery.ui.slider'; +@import 'jquery-ui/datepicker'; +@import 'jquery-ui/slider'; @import 'jquery-ui-timepicker-addon'; .dropdown_menu { diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3192ec8..0984c6e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -8,6 +8,6 @@ * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * - *= require_self *= require_tree . + *= require_self */ diff --git a/bin/rails b/bin/rails index 728cd85..7feb6a3 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 1724048..8017a02 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100644 index 0000000..acdb2c1 --- /dev/null +++ b/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000..7b45d37 --- /dev/null +++ b/bin/spring @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require "rubygems" + require "bundler" + + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) + Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } + gem "spring", match[1] + require "spring/binstub" + end +end diff --git a/config/application.rb b/config/application.rb index 5b99375..d84b345 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,5 +31,8 @@ class Application < Rails::Application # config.i18n.default_locale = :de config.middleware.use 'EndlessAssimilation' + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true end end diff --git a/config/boot.rb b/config/boot.rb index 5e5f0c1..6b750f0 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,3 @@ -# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/environment.rb b/config/environment.rb index 27a6ef2..ee8d90d 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,4 +2,4 @@ require File.expand_path('../application', __FILE__) # Initialize the Rails application. -VoicerepublicBackoffice::Application.initialize! +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 1eb4eb0..b55e214 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,4 @@ -VoicerepublicBackoffice::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on @@ -19,7 +19,7 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise an error on page load if there are pending migrations + # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Debug mode disables concatenation and preprocessing of assets. @@ -27,6 +27,15 @@ # number of complex assets. config.assets.debug = true + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + # Raises error for missing translations # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index 115537e..63d90a0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,4 @@ -VoicerepublicBackoffice::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. @@ -20,7 +20,7 @@ # config.action_dispatch.rack_cache = true # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier @@ -32,9 +32,6 @@ # Generate digests for assets URLs. config.assets.digest = true - # Version of your assets, change this if you want to expire all your assets. - config.assets.version = '1.0' - # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx @@ -72,9 +69,9 @@ # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify - # Disable automatic flushing of the log to improve performance. - # config.autoflush_log = false - # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false end diff --git a/config/environments/test.rb b/config/environments/test.rb index 2a87569..8812fbb 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -VoicerepublicBackoffice::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's @@ -13,7 +13,7 @@ config.eager_load = false # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true + config.serve_static_files = true config.static_cache_control = "public, max-age=3600" # Show full error reports and disable caching. @@ -31,6 +31,9 @@ # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + # Randomize the order test cases are executed. + config.active_support.test_order = :random + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 72aca7e..dc18996 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,4 +2,3 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index 5af80e1..0000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -VoicerepublicBackoffice::Application.config.secret_key_base = '5f4e69444a11dd5684f9a536285178966294ac794b80e98fcdd35f063a277714c9d9f69ca834c95527a71b188980f1f3514c42ab1bbed0248c40720478f3be94' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 4b7e0eb..a8c745b 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -VoicerepublicBackoffice::Application.config.session_store :cookie_store, key: '_voicerepublic_backoffice_session' +Rails.application.config.session_store :cookie_store, key: '_voicerepublic_backoffice_session' diff --git a/config/routes.rb b/config/routes.rb index 1a0c4b5..85ef7b3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,4 @@ -VoicerepublicBackoffice::Application.routes.draw do +Rails.application.routes.draw do root to: "admin/dashboard#index" diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..38eafaf --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: a44a31d23f54d081b9f3737ab886048a01e2188e659d53ea608b997bb34a6dcc77b91b729a607807fb6771b6cfcd76be09bfdd0f07a6021c2c0969a07fa11755 + +test: + secret_key_base: a44a31d23f54d081b9f3737ab886048a01e2188e659d53ea608b997bb34a6dcc77b91b729a607807fb6771b6cfcd76be09bfdd0f07a6021c2c0969a07fa11755 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> \ No newline at end of file