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

Ticket #9459 (new enhancement)

Opened 1 year ago

Last modified 8 months ago

[PATCH] Fill out some Hash methods for CookieJar, remove deprecated code

Reported by: kampers Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords: cookie
Cc: uwe@kubosch.no

Description

CookieJar inherits from Hash, and overrides [], []=, and delete to give users familiar Hash semantics. But I've been surprised a couple times when other Hash methods I tried to use crashed and burned.

Here's a patch to implement clear and delete_if (chosen because they do deleting, probably the most important special case that CookieJar has to implement). Hopefully I'll have some more coming down the pipe soon.

While I was at it, I removed the deprecated cookie setter method, did a doc/code cleanup, and cleaned up some of the tests.

Attachments

cookie_cleanup_and_hash_delete_methods.diff (8.7 kB) - added by kampers on 08/31/07 20:38:44.

Change History

08/31/07 20:38:44 changed by kampers

  • attachment cookie_cleanup_and_hash_delete_methods.diff added.

08/31/07 22:15:03 changed by norbert

While the new methods are what I would consider edge cases (the rest still doesn't work, unfortunately), they might be useful and the cleanup looks good. +1

02/25/08 19:17:08 changed by donv

  • cc set to uwe@kubosch.no.