Calling FullcalendarEngine::Event.new.valid? resulted in NoMethodError: undefined method>=' for nil:NilClassonapp/models/fullcalendar_engine/event.rb:21:in validate_timings'
Starttime and endtime can be nil and >= is obviously not available on nil. Instead, validate_timings now verifies that both starttime and endtime are set before calling >=.
Presence validations for starttime and endtimes are also added, so the model will still be invalid even though >= is not called in validate_timings.
Calling
FullcalendarEngine::Event.new.valid?
resulted inNoMethodError: undefined method
>=' for nil:NilClasson
app/models/fullcalendar_engine/event.rb:21:invalidate_timings'
Starttime and endtime can be nil and
>=
is obviously not available on nil. Instead,validate_timings
now verifies that bothstarttime
andendtime
are set before calling>=
.Presence validations for
starttime
andendtimes
are also added, so the model will still be invalid even though>=
is not called invalidate_timings
.