# "@marshal\_with\_utc\_coercion": false?

**URL:** <https://www.ruby-forum.com/t/marshal-with-utc-coercion-false/166403>\
**Category:** Rails\
**Created:** [April 24, 2009, 9:03pm UTC](https://www.ruby-forum.com/t/marshal-with-utc-coercion-false/166403 "2009-04-24T21:03:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [April 24, 2009, 9:03pm UTC](https://www.ruby-forum.com/t/marshal-with-utc-coercion-false/166403/1 "2009-04-24T21:03:14Z")

</div>

this is a debug on the @schedules variable which contains a bunch of  
start and end times pulled from a mysql database.

attributes:  
schedule\_type: “7”  
schedule\_start: 2009-04-24 04:00:00  
id: “21”  
uid: “12”  
schedule\_end: 2009-04-24 11:00:00  
attributes\_cache:  
schedule\_start: !timestamp  
at: “2009-04-24 04:00:00 -04:00”  
“@marshal\_with\_utc\_coercion”: false  
schedule\_end: !timestamp  
at: “2009-04-24 11:00:00 -04:00”  
“@marshal\_with\_utc\_coercion”: false

i have no clue what this means… I’ve never gotten this one before.

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [April 24, 2009, 9:04pm UTC](https://www.ruby-forum.com/t/marshal-with-utc-coercion-false/166403/2 "2009-04-24T21:04:45Z")

</div>

Morgan M. wrote:

> this is a debug on the @schedules variable which contains a bunch of  
> start and end times pulled from a mysql database.
> 
> attributes:  
> schedule\_type: “7”  
> schedule\_start: 2009-04-24 04:00:00  
> id: “21”  
> uid: “12”  
> schedule\_end: 2009-04-24 11:00:00  
> attributes\_cache:  
> schedule\_start: !timestamp  
> at: “2009-04-24 04:00:00 -04:00”  
> “@marshal\_with\_utc\_coercion”: false  
> schedule\_end: !timestamp  
> at: “2009-04-24 11:00:00 -04:00”  
> “@marshal\_with\_utc\_coercion”: false
> 
> i have no clue what this means… I’ve never gotten this one before.

i thought i’d post the whole debug

- !ruby/object:schedule  
attributes:  
schedule\_type: “7”  
schedule\_start: 2009-04-24 04:00:00  
id: “21”  
uid: “12”  
schedule\_end: 2009-04-24 11:00:00  
attributes\_cache:  
schedule\_start: !timestamp  
at: “2009-04-24 04:00:00 -04:00”  
“@marshal\_with\_utc\_coercion”: false  
schedule\_end: !timestamp  
at: “2009-04-24 11:00:00 -04:00”  
“@marshal\_with\_utc\_coercion”: false

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [April 24, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/marshal-with-utc-coercion-false/166403/3 "2009-04-24T22:32:24Z")

</div>

Jeremy K. wrote:

> It’s Active Support fixing a bug in Ruby 1.8.x where UTC times are  
> incorrectly unmarshaled as local, not UTC, times.
> 
> So we flag that the time is UTC when it’s dumped and coerce it back to  
> UTC when it’s loaded.
> 
> jeremy
> 
> On Fri, Apr 24, 2009 at 12:03 PM, Morgan M.

i just noticed that it produces a page of errors in the error log.

Exception occurred during reader method compilation.  
Maybe 11 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 11; missing\_attribute(‘11’, caller) unless  
@attributes.has\_key?(‘11’); @attributes[‘11’]; end  
^  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected kEND, expecting $end  
def 11; missing\_attribute(‘11’, caller) unless  
@attributes.has\_key?(‘11’); @attributes[‘11’]; end  
^  
Exception occurred during reader method compilation.  
Maybe 11 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 11=(new\_value);write\_attribute(‘11’, new\_value);end  
^  
Exception occurred during reader method compilation.  
Maybe 11 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 11?; query\_attribute(‘11’); end  
^  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected kEND, expecting $end  
def 11?; query\_attribute(‘11’); end  
^  
Exception occurred during reader method compilation.  
Maybe 12 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 12; missing\_attribute(‘12’, caller) unless  
@attributes.has\_key?(‘12’); @attributes[‘12’]; end  
^  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected kEND, expecting $end  
def 12; missing\_attribute(‘12’, caller) unless  
@attributes.has\_key?(‘12’); @attributes[‘12’]; end  
^  
Exception occurred during reader method compilation.  
Maybe 12 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 12=(new\_value);write\_attribute(‘12’, new\_value);end  
^  
Exception occurred during reader method compilation.  
Maybe 12 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 12?; query\_attribute(‘12’); end  
^  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected kEND, expecting $end  
def 12?; query\_attribute(‘12’); end  
^  
Exception occurred during reader method compilation.  
Maybe 13 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 13; missing\_attribute(‘13’, caller) unless  
@attributes.has\_key?(‘13’); @attributes[‘13’]; end  
^  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected kEND, expecting $end  
def 13; missing\_attribute(‘13’, caller) unless  
@attributes.has\_key?(‘13’); @attributes[‘13’]; end  
^  
Exception occurred during reader method compilation.  
Maybe 13 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 13=(new\_value);write\_attribute(‘13’, new\_value);end  
^  
Exception occurred during reader method compilation.  
Maybe 13 is not a valid Ruby identifier?  
compile error  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected tINTEGER  
def 13?; query\_attribute(‘13’); end  
^  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:211:  
syntax error, unexpected kEND, expecting $end  
def 13?; query\_attribute(‘13’); end  
^

i don’t know if this is normal…

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [May 18, 2009, 11:13pm UTC](https://www.ruby-forum.com/t/marshal-with-utc-coercion-false/166403/4 "2009-05-18T23:13:03Z")

</div>

So is there any way to make this stop happening that doesn’t involve  
going back to an old version of rails.

---

<div class="post-metadata">

**Author:** ![morgan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@morgan](https://www.ruby-forum.com/u/morgan)\
**Post date:** [April 24, 2009, 10:17pm UTC](https://www.ruby-forum.com/t/marshal-with-utc-coercion-false/166403/5 "2009-04-24T22:17:10Z")

</div>

It’s Active Support fixing a bug in Ruby 1.8.x where UTC times are  
incorrectly unmarshaled as local, not UTC, times.

So we flag that the time is UTC when it’s dumped and coerce it back to  
UTC when it’s loaded.

jeremy

On Fri, Apr 24, 2009 at 12:03 PM, Morgan M.
