a1dert/lh-tickets-test — Issue #305: Errors when add/update/view purchase or expense with long details
Author: a1dert
Created: 2011-11-30 12:04:59+00:00
State: open
Labels: tracker

Imported from lighthouse. Original ticket at: http://redtape.lighthouseapp.com/projects/59696/tickets/310. Created by Alexey Derkach - 2011-06-06T12:10:23Z

1. Go to Purchase page (for example).
2. Try to add purchase with text in details longer than 249 symbols.
3. You get an internal server error. Also happens on update or view list of purchases with broken purchase.

Details (this error happens when user try to open Purchases page after adding broken purchase):
NoMethodError in Demands#index

Showing /var/www/apps/redtape/staging/releases/20110606085925/app/views/demands/_demand_state.html.erb where line #1 raised:
@@@
undefined method `to’ for nil:NilClass
@@@

Trace:
@@@ ruby
app/views/demands/demand_state.html.erb:1:in `_app_views_demands_demand_state_html_erb___2081373613_60227740_4299468’
app/views/demands/demand.html.erb:18:in `_app_views_demands_demand_html_erb___939769450_60327200_2839230’
app/views/demands/index.html.erb:15:in `_app_views_demands_index_html_erb___671232123_61145080_0’
app/views/demands/index.html.erb:14:in `_app_views_demands_index_html_erb___671232123_61145080_0’
@@@

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

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