开发者

Ruby on Rails - can't access datetime model object

I've created a model that has 3 string columns and a datetime. Everything is running in SQLite3 and I can view the records in my table just fine using Lita.

I'm trying to display the values in a page (index action) using code like this:

开发者_运维技巧

From the debug I get a result like this:

--- !ruby/object:LifeCycle attributes: eventType: Order created_at: "2111359287.23037" timeId: "2455364.89983796" eventId: "98765" updated_at: "2111359287.23037" lifeCycleId: "12345" id: "1" attributes_cache: {}

But whenever I try to access the event timeId - i' getting a nil value. This is true if i try to run debug on just that field debug(lifeCycle.timeId), or call a function on it.

Is there something obvious I'm missing here?


Figured out problem - in datetime fields in database were not create properly when adding record w/ Lita. Redid it w/ sqlite manager for Firefox and everything works great.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜