-
Notifications
You must be signed in to change notification settings - Fork 190
Closed
Description
Ref: rails/rails#55423
The deserialization code blindy tries to put each key-value pair into a writer method:
Lines 17 to 23 in b77e86c
| def initialize(hash=nil, **kwargs) | |
| warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) if hash | |
| (hash || kwargs).each do |key, val| | |
| send("#{key}=", val) | |
| end | |
| end |
Since older versions don't have the dimension, trying to assign to it fails. I wonder if the code should be more careful with that and rescue NameError or similar. Would that make sense?
This is in the context of a rails app where rolling deploys are happening. Apps with the new code cache the new dimension field and older apps that haven't been rotated yet will fail to read it. Rails actually discourages caching full models for similar reasons but people tend to do so anyways since it works 99.99% of the time.
Sprunth
Metadata
Metadata
Assignees
Labels
No labels