CyberCraftInc / vacation_system

Cyber Craft Vacation System
0 stars 0 forks source link

Update VacationRequest model validation #14

Closed eleidan closed 9 years ago

eleidan commented 9 years ago

The VacationRequest model implements validation method cannot_intersect_with_other_vacations() that looks into DB and checks if there are any records that intersect with the new record. There must be no records that have days from the period of the new vacation request.

Update factory for users so that it generates valid vacation requests

Update factory for vacation requests so that it initialize start_date property dynamically, that is, with the Time.zone.now() method.

Update tests for VacationRequest model Test VacationRequest#cannot_intersect_with_other_vacations method. Rework test for validation of inclusion of actual_end_date property in permitted date range.

Update BB VacationRequest model Move the user_id attribute from the list of defaults to the list of expected attributes.

Update BB VacationRequestForm view Add listener for the error event on VacationRequest model.

Update copyright statement

@alazarchuk , @rubycop , @epmlys

rubycop commented 9 years ago

LGFM. @alazarchuk you can merge this PR