Add Gitlab.rails5? method

This commit is contained in:
blackst0ne 2018-03-09 17:25:17 +11:00
parent 7734e85bc6
commit 1fe02c3c3a
1 changed files with 6 additions and 0 deletions

View File

@ -194,4 +194,10 @@ module Gitlab
Gitlab::Routing.add_helpers(MilestonesRoutingHelper)
end
end
# 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])
end
end