Answer the question
In order to leave comments, you need to log in
How to update Activerecord with unixtimestamp time?
I suspect that the solution is simple, but I did not find something in the dock.
With the help of ajax, I send a parameter update, where one of the attributes is unixtimestamp.
But in Order and in the database it is datetime.
Now I do this:
order = params[:order]
order[:order_date] = Time.at(order[:order_date].to_i).to_datetime
order_item.update_attributes(order.permit( :order_date))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question