ruby on rails - Can I use PostgreSQL's "Special Date/Time Inputs" with ActiveRecord? -


postgresql supports several "special date/time inputs", strings interprets upon execution. eg, 'now' means "current transaction's start time", , 'infinity' means "later other timestamps".

activerecord not seem understand these - eg, somerecord.update!(updated_at: datetime.current) works, somerecord.update!(updated_at: 'now') tries execute update query null.

these special strings work in rails fixtures, because go straight database. there way use them instantiated model?

you can set value raw_write_attribute(:updated_at, 'now')


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -