# Why I can't get the date value?

**URL:** <https://www.ruby-forum.com/t/why-i-cant-get-the-date-value/125303>\
**Category:** Rails\
**Created:** [January 8, 2008, 2:28am UTC](https://www.ruby-forum.com/t/why-i-cant-get-the-date-value/125303 "2008-01-08T02:28:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@OnRails](https://www.ruby-forum.com/u/OnRails)\
**Post date:** [January 8, 2008, 2:28am UTC](https://www.ruby-forum.com/t/why-i-cant-get-the-date-value/125303/1 "2008-01-08T02:28:46Z")

</div>

On rails 2.0.2, I debug:  
raise @person.inspect  
I got:  
#\<Person id: 102, created\_at: “2006-08-16 00:37:50”, updated\_at:  
“2008-01-07 10:46:49”, points\_count: 0\>

raise @person.id.inspect  
I got  
“102”  
raise @person.points\_count.inspect  
I got  
“0”

but when I use removed\_email\_address@domain.invalid\_at.inspect and  
removed\_email\_address@domain.invalid\_at.inspect  
I got same error:  
You have a nil object when you didn’t expect it!  
You might have expected an instance of ActiveRecord::Base.  
The error occurred while evaluating nil.[]

why? and the date type is different in rails 1.2.6 and 2.0.2?  
who can help me? Thanks!

---

<div class="post-metadata">

**Author:** ![OnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@OnRails](https://www.ruby-forum.com/u/OnRails)\
**Post date:** [January 8, 2008, 2:50am UTC](https://www.ruby-forum.com/t/why-i-cant-get-the-date-value/125303/2 "2008-01-08T02:50:24Z")

</div>

Why are you raise’ing? You can just do puts.

Try puts @person.created\_at.inspect

On Jan 8, 2008 11:58 AM, OnRails [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> raise @person.points\_count.inspect
> 
> why? and the date type is different in rails 1.2.6 and 2.0.2?  
> who can help me? Thanks!
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.
