a1dert/lh-tickets-test — Issue #285: ArgumentError in Demands#new when try to add time-off request
Author: a1dert
Created: 2011-11-30 12:03:43+00:00
State: open

Imported from lighthouse. Original ticket at: http://redtape.lighthouseapp.com/projects/59696/tickets/325. Created by Alexey Derkach - 2011-06-14T11:09:37Z

1. Go to Settings → Time Off page.
2. Change “Time off year ends on the same day for everyone” fields to date February, 28 (for example)
3. Settings are saved.
4. Go to Time Off page.
5. Try to request time off.
6. You get an error.

Details:
Showing /var/www/apps/redtape/staging/releases/20110610135651/app/views/demands/time_offs/_form.html.erb where line #53 raised:
@@@
invalid date
@@@

Trace:
@@@ ruby
app/models/user.rb:141:in `year_range’
app/models/user.rb:141:in `map’
app/models/user.rb:141:in `year_range’
app/extensions/time_off_days.rb:22:in `max_date’
app/views/demands/time_offs/form.html.erb:53:in `_app_views_demands_time_offs_form_html_erb___1016180563_59625560_3729516’
app/views/demands/time_offs/form.html.erb:1:in `_app_views_demands_time_offs_form_html_erb___1016180563_59625560_3729516’
app/helpers/demands_helper.rb:21:in `render_demand_partial’
app/helpers/demands_helper.rb:16:in `render_form’
app/views/demands/new.js.erb:1:in `_app_views_demands_new_js_erb__1550840902_59652260_0’
app/controllers/demands_controller.rb:57:in `new’
@@@

Request:
@@@ javascript
{"model_type"=>"time_offs"}
@@@

According to: [story 6509](https://tracker.anahoret.com/projects/44/stories/6509 "story 6509")