From 7351917ee400101fc13ff34c5db437c3ed416234 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Thu, 11 Sep 2014 11:05:29 -0700 Subject: [PATCH] Boolean -> String quoting has changed on Rails master CustomField.create(name: 'zomg', value: true).reload.value # => 't' on Rails 4.1, '1' on 4.2 rails/rails@42be84ba --- app/models/concerns/has_custom_fields.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/has_custom_fields.rb b/app/models/concerns/has_custom_fields.rb index cd9349539..cfe0db590 100644 --- a/app/models/concerns/has_custom_fields.rb +++ b/app/models/concerns/has_custom_fields.rb @@ -12,7 +12,7 @@ module HasCustomFields end end - CUSTOM_FIELD_TRUE = ['t','true', 'T', 'True', 'TRUE'].freeze unless defined? CUSTOM_FIELD_TRUE + CUSTOM_FIELD_TRUE = ['1', 't', 'true', 'T', 'True', 'TRUE'].freeze unless defined? CUSTOM_FIELD_TRUE def self.cast_custom_field(key, value, types) return value unless types && type = types[key]