mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
value has the right type here
using `enum kind: [ :any, :income, :expense ]` syntax, value is already an
integer and using `enum kind: { any: 'any', income: 'income', expense:
'expense' }` syntax value is a string.
This allows us to define the mapping in the enum definition.
This reverts commit 933decceaf
.
This commit is contained in:
parent
8167fa4562
commit
e991c7b8cd
1 changed files with 1 additions and 1 deletions
|
@ -124,7 +124,7 @@ module ActiveRecord
|
|||
|
||||
def deserialize(value)
|
||||
return if value.nil?
|
||||
mapping.key(value.to_i)
|
||||
mapping.key(value)
|
||||
end
|
||||
|
||||
def serialize(value)
|
||||
|
|
Loading…
Reference in a new issue