diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-08-22 14:09:28 +0200 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-11-14 12:38:30 +0100 |
commit | 547dc7ac600d3a8dfe61035fc35e82d11bea4aee (patch) | |
tree | 232d1a27c9f716ac4c17277ae542d7ccd3ff3ee9 /config | |
parent | c93439605bdad009754be70007c798b3d345e677 (diff) | |
download | gitlab-ce-547dc7ac600d3a8dfe61035fc35e82d11bea4aee.tar.gz |
Switch to Rails 5 by default
* updates Gemfile
* uses Rails 5 unless explicitly disabled
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 2 | ||||
-rw-r--r-- | config/boot.rb | 4 | ||||
-rw-r--r-- | config/environment.rb | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/config/application.rb b/config/application.rb index 95b0f74a5a3..1b084e91cfb 100644 --- a/config/application.rb +++ b/config/application.rb @@ -8,7 +8,7 @@ module Gitlab # This method is used for smooth upgrading from the current Rails 4.x to Rails 5.0. # https://gitlab.com/gitlab-org/gitlab-ce/issues/14286 def self.rails5? - ENV["RAILS5"].in?(%w[1 true]) + !%w[0 false].include?(ENV["RAILS5"]) end class Application < Rails::Application diff --git a/config/boot.rb b/config/boot.rb index 655c54ddb84..1aeacdabbad 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,10 +1,10 @@ def rails5? - %w[1 true].include?(ENV["RAILS5"]) + !%w[0 false].include?(ENV["RAILS5"]) end require 'rubygems' unless rails5? -gemfile = rails5? ? "Gemfile.rails5" : "Gemfile" +gemfile = rails5? ? "Gemfile" : "Gemfile.rails4" ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__) # Set up gems listed in the Gemfile. diff --git a/config/environment.rb b/config/environment.rb index 5d35937f7c6..3a52656a2c1 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,10 +1,10 @@ # Load the rails application # Remove this condition when upgraded to rails 5.0. -if %w[1 true].include?(ENV["RAILS5"]) - require_relative 'application' -else +if %w[0 false].include?(ENV["RAILS5"]) require File.expand_path('application', __dir__) +else + require_relative 'application' end # Initialize the rails application |