I have a method that removes some errors from the
ActiveRecord::Base#errors object. After updating my app to 2.3.4, I
find that the removal process is broken. Witness:
h.slice!(:a)
h.keys => [:a] GOOD
oh.slice!(:a);oh.keys => [:a, :b] OUCH!
NB: #slice works fine on ordered hashes, but not the in-place variant.
This is in Ruby 1.8.7 on Rails 2-3-stable.
So, is this behavior a bug? It kinda falls into the undefined
behavior, but for consistency/least surprise it should probably remove
the keys from an ordered hash, not just nullify the values.
So, is this behavior a bug? It kinda falls into the undefined
behavior, but for consistency/least surprise it should probably remove
the keys from an ordered hash, not just nullify the values.
This looks like a bug to me, file a ticket for it in lighthouse so we
can fix it. Attaching a patch would be even better