vinsol / fullcalendar-rails-engine

Rails engine implementation of fullcalendar jQuery plugin(http://arshaw.com/fullcalendar/). Create, edit, delete, reschedule, resize events like google calendar.
http://vinsol.com/fullcalendar-demo
MIT License
66 stars 51 forks source link

Fixes validation problem #27

Closed ehannes closed 8 years ago

ehannes commented 8 years ago

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.