Before_type_case broken?


I’ve noticed that I seem unable to get a _before_type_cast value for
dates in 2.1. Specifically, if I assign a date string to a date
attribute, and then call attribute_before_type_cast I get a TimeWithZone
instead of a String:

model.start_date = “2001/01/02”
model.start_date.class = ActiveSupport::TimeWithZone
model.start_date_before_type_cast.class = ActiveSupport::TimeWithZone

Examining the @attributes in AR/lib/attribute_method.rb shows that the
entries are already TimeWithZones, whereas in 2.0 they are Strings.

Has anyone else come across this?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs