summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-04-09 07:57:37 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-04-09 07:57:37 +0000
commit1917d53b2282d28eff43b550d8e38ba2be075b77 (patch)
tree12e16274b65c6589e6a4aa78ed567545d04a8c7f
parente7ddb40cd595215d42e2ab9790462ae9bcd7a0cb (diff)
parent432e57fccfcc854f8aedc578111c1d4a6b0f4a2d (diff)
downloadgitlab-ce-1917d53b2282d28eff43b550d8e38ba2be075b77.tar.gz
Merge branch 'blackst0ne-rails5-replace-true-values-with-false-values' into 'master'
[Rails5] Add FALSE_VALUES constant to Service#boolean_accessor See merge request gitlab-org/gitlab-ce!18240
-rw-r--r--app/models/service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/service.rb b/app/models/service.rb
index e9b6f005aec..f7e3f7590ad 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -206,7 +206,11 @@ class Service < ActiveRecord::Base
args.each do |arg|
class_eval %{
def #{arg}?
- ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(#{arg})
+ if Gitlab.rails5?
+ !ActiveModel::Type::Boolean::FALSE_VALUES.include?(#{arg})
+ else
+ ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(#{arg})
+ end
end
}
end