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
This commit is contained in:
Godfrey Chan 2014-09-11 11:05:29 -07:00
parent f955ec6018
commit 7351917ee4
1 changed files with 1 additions and 1 deletions

View File

@ -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]