I have a rails 4 form in which a user inputs a string that represents a datetime:
<%= f.text_field :time_frame, class: "calender_pop" %><br />
No where in my code am I converting the string into a datetime. I have tried entering non-datetime input into the field (i.e. integers, strings, etc...) but datetime won't accept them. If i try to enter a non-datetime value, datetime becomes nil. This is good, but I am confused because I never wrote any such validation. I have used postgres before and have been able to put integers into string columns, so I am not aware of any automatic validations on the part of postgres or rails.
- Does postgres or rails automatically validate datetime?
- Is the time_frame column being filled with a string or a datetime?
I am also using the query datetimepicker plugin, but i don't think that should have anything to do with datatypes.
UPDATE:
I ran:
Task.last.time_frame.is_a? Time
and it returned true.
So question 3. What is happening? How and when is it getting converted into a Time?
Update:
I just read that postgres actually does not have a datetime type. Could it have something to do with the orm changing the datatype?