You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working in a legacy project which we're trying to upgrade but right now that's not possible (lot of code, can't stop the production servers, almost no coverage, etc) so we have to keep with rails 3.0.20 for now.
The problem is happening with all models which have serialized attributes, all of this models there is no array columns btw.
You can reproduce the problem creating a empty model with a serialized attribute like this:
classPost < ActiveRecord::Baseserialize:metaend
When we try to create a record, the following exception is raised:
NoMethodError (undefined method `serialized_value' for #<ActiveSupport::HashWithIndifferentAccess:0x007f86ecc36610>)
Looking at source code, I found the problem at this line.
The problem is that method is different for each version of active record:
I fixed it monkey patching the method to the similar version for 3.0 on my application but it would be great if we fix that on activerecord-postgres-array since we will keep using it until we can get to 4.0 which is planned to 5 or 6 months from now.
In the past we did a kind of check for each version of active record on ar-octopus due to a similar problem, you can see the solution at these lines which is not elegant but solves the same problem.
What do you think? Would you accept a pull request fixing the compatibility for rails 3.0 and 3.1?
The text was updated successfully, but these errors were encountered:
Hey @tlconnor,
I'm working in a legacy project which we're trying to upgrade but right now that's not possible (lot of code, can't stop the production servers, almost no coverage, etc) so we have to keep with rails 3.0.20 for now.
The problem is happening with all models which have serialized attributes, all of this models there is no array columns btw.
You can reproduce the problem creating a empty model with a serialized attribute like this:
When we try to create a record, the following exception is raised:
Looking at source code, I found the problem at this line.
The problem is that method is different for each version of active record:
I fixed it monkey patching the method to the similar version for 3.0 on my application but it would be great if we fix that on activerecord-postgres-array since we will keep using it until we can get to 4.0 which is planned to 5 or 6 months from now.
In the past we did a kind of check for each version of active record on ar-octopus due to a similar problem, you can see the solution at these lines which is not elegant but solves the same problem.
What do you think? Would you accept a pull request fixing the compatibility for rails 3.0 and 3.1?
The text was updated successfully, but these errors were encountered: