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:
parent
f955ec6018
commit
7351917ee4
|
@ -12,7 +12,7 @@ module HasCustomFields
|
||||||
end
|
end
|
||||||
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)
|
def self.cast_custom_field(key, value, types)
|
||||||
return value unless types && type = types[key]
|
return value unless types && type = types[key]
|
||||||
|
|
Loading…
Reference in New Issue