Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7224 (closed defect: duplicate)

Opened 1 year ago

Last modified 1 year ago

[PATCH] Fix in_place_editor and set_content_length problem with BigDecimal and others

Reported by: jeremymcanally Assigned to: core
Priority: normal Milestone: 1.2.4
Component: ActionPack Version: edge
Severity: major Keywords: inplacediting, cgi
Cc:

Description

This patch fixes a problem described in #7198 where in_place_editor throws an exception if use with BigDecimal fields (and Float fields and others).

This patch adds a check in set_content_length! to make sure the @body object can respond to size; if not, it calls to_s on it and tries to get that size (since it will be sending a string back anyhow).

Attachments

fix_in_place_editor_and_set_content_length.diff (0.8 kB) - added by jeremymcanally on 01/20/07 04:27:45.
SVN diff

Change History

01/20/07 04:27:45 changed by jeremymcanally

  • attachment fix_in_place_editor_and_set_content_length.diff added.

SVN diff

(in reply to: ↑ description ) 02/15/07 10:14:34 changed by Andreas

Replying to jeremymcanally:

This patch fixes a problem described in #7198 where in_place_editor throws an exception if use with BigDecimal fields (and Float fields and others). This patch adds a check in set_content_length! to make sure the @body object can respond to size; if not, it calls to_s on it and tries to get that size (since it will be sending a string back anyhow).

I don't like this patch. Rendering arbitrary objects to strings is not the job of ActionController. @body must be a string, nothing else. #7418 fixes the in_place_editor problem in a simpler way.

04/21/07 00:40:06 changed by josh

  • status changed from new to closed.
  • resolution set to duplicate.

Closing in favor of #7418.