开发者

Ruby on Rails - can't access datetime model object

开发者 https://www.devze.com 2023-01-04 07:48 出处:网络
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'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

精彩评论

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