aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/locale
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2017-01-03 11:15:16 -0500
committerSean Griffin <sean@seantheprogrammer.com>2017-01-03 11:15:16 -0500
commit0f1d0b1b5254e3678abaabbebb3362a100c10262 (patch)
tree45524fa9caa4d75e80575c7984979930f9b43edf /activerecord/lib/active_record/locale
parent0d8069d36543947dc948cbbd02c8214c352b7aad (diff)
downloadrails-0f1d0b1b5254e3678abaabbebb3362a100c10262.tar.gz
rails-0f1d0b1b5254e3678abaabbebb3362a100c10262.tar.bz2
rails-0f1d0b1b5254e3678abaabbebb3362a100c10262.zip
Consistently apply adapter behavior when serializing arrays
In f1a0fa9 we moved backend specific timestamp behavior out of the type and into the adapter. This was in line with our general attempt to reduce the number of adapter specific type subclasses. However, on PG, the array type performs all serialization, including database encoding in its serialize method. This means that we have converted the value into a string before reaching the database, so no adapter specific logic can be applied (and this also means that timestamp arrays were using the default `.to_s` method on the given object, which likely meant timestamps were being ignored in certain cases as well) Ultimately I want to do a more in depth refactoring which separates database serializer objects from the active model type objects, to give us a less awkward API for introducing the attributes API onto Active Model. However, in the short term, we follow the solution we've applied elsewhere for this. Move behavior off of the type and into the adapter, and use a data object to allow the type to communicate information up the stack. Fixes #27514.
Diffstat (limited to 'activerecord/lib/active_record/locale')
0 files changed, 0 insertions, 0 deletions