This project is archived and is in readonly mode.
Patch for ActiveSupport that Array#uniq and #uniq! supports blocks
-
Dmitry Polushkin
Overheat, it could be done using:
a.map(&:downcase).uniq -
Artūras Šlajus
But doing so destroys original values.
For example my patch is very useful for tagging support where we want to keep original values.
>> a = ["Drum and bass", "drum'and'bass"] => ["Drum and bass", "drum'and'bass"] >> a.map { |i| i.parameterize.to_s }.uniq => ["drum-and-bass"] >> a.uniq { |i| i.parameterize.to_s } => ["Drum and bass"] -
Artūras Šlajus
And why does other stuff in activesupport belong in core? Not that I like being itchy but this patch doesn't hurt and perhaps it will be useful for someone?
What's the motivation of dropping it out?
