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

Ticket #7369 (closed enhancement: wontfix)

Opened 2 years ago

Last modified 8 months ago

[PATCH] Hash#without to mirror Hash#slice

Reported by: eventualbuddha Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: slice without hash
Cc:

Description

This patch adds Hash#without, which is the opposite of Hash#slice. Quick example:

Event.new(event.attributes.without(:id, :user_id))

Attachments

hash-without.diff (2.5 kB) - added by eventualbuddha on 01/25/07 06:39:29.
hash-without.2.diff (2.7 kB) - added by mpalmer on 07/20/07 00:39:19.
Rebased patch

Change History

01/25/07 06:39:29 changed by eventualbuddha

  • attachment hash-without.diff added.

02/24/07 18:33:45 changed by josh

  • keywords changed from slice without hash to slice without hash verified.

07/20/07 00:39:19 changed by mpalmer

  • attachment hash-without.2.diff added.

Rebased patch

07/20/07 00:41:10 changed by mpalmer

  • keywords changed from slice without hash verified to slice without hash.

Rebased against current trunk (the old patch applied but the test changes ended up in the wrong test case!). Looks good to me, tests are solid and the implementation is reasonable. +1. Needs one more.

04/02/08 11:45:06 changed by pratik

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

(In [9209]) Adding Hash#without Closes #7369 [eventualbuddha]

04/02/08 11:58:46 changed by Henrik N

  • status changed from closed to reopened.
  • resolution deleted.

pratik: see hash/except.rb – this has been around for a while already, as Hash#except.

04/02/08 12:52:45 changed by lifofifo

My bad. Reverted in [9210]

04/02/08 13:43:10 changed by NoKarma

  • status changed from reopened to closed.
  • resolution set to wontfix.

Marked as Wontfix. Please use Hash#except.