the columns of type DateTime. I have pasted the code for the
validation and works well for creating a new record. However, when
trying to update the record where the columns from and to (of type
DateTime) are null, then they are not set in the update call. It seems
like i am checking to see if the attribute is present and then does
not find one (i guess it looks in the prior saved values in the db
which is indeed empty?) even though on is sent in the update request.
self.from = Time.parse(from.to_s) if attribute_present?("from")
self.to = Time.parse(to.to_s) if attribute_present?("to")
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to email@example.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.