I am developing a web application to book machines for an event.
so I have an event model
class Event < ActiveRecord::Base
and a datetime model
class Datetime < ActiveRecord::Base
I have developed a view with the event information and information for
the datetimes. and in the event_controller when I capture a datetime I
@datetime = params …
@event.datetimes << @datetime.
My problem is that “@event.datetimes<<@datetime” saves the datetime to
the datetimes table in the database. And after that when I validate the
event for the datetimes not to overlap if I return an error the bad
datetime is already saved!!
I don’t want the datetime being saved when I introduce it in the
thanks in advance