New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read_attribute does not do the type cast with PostgreSQL #5607
Comments
Hey @maxime-menant. I think it was fixed in the master version, but it was not a trivial fix, so I think it will not be backported to the 3-2-stable branch. Could you check your code with the Rails master branch? Thanks for reporting. cc @tenderlove |
Hi @maxime-menant, I'm closing this because it's a duplicate of #5549. I've made a fix on master, but we're discussing how to fix this on 3-2-stable in #5549. |
Hi, thanks for your help! I will try the 3-2 stable branch on my project when you have found how to backport the fix from the master. |
It works with the last version of the 3-2-stable branch! Thanks a lot for this quick fix |
I am migrating from mysql to PostgreSQL, in my Event model I redefine the accessor of one attribute (a datetime field) using
But when I call event.startdate I get "2012-02-06 07:00:00" #String instead of Mon, 06 Feb 2012 07:00:00 0000 # DateTime with the mysql adapter
I think that is the behavior of "read_attribute_before_type_cast" and not "read_attribute", no ?
Using Ruby 1.9.2 / Rails 3.2.2 and PostgreSQL 9.1.3
The text was updated successfully, but these errors were encountered: