Commit 0f0e4244 authored by Holger Just's avatar Holger Just

Overwrite compact on child class of Array to not return an instance of Array

This is necessary because in Ruby 1.9.3, the behavior of an internal dup of
the array (rb_ary_dup) was changed to always return an array instance, not
an instance of the actual class which it was working on.

Why can't people just stick to what works but instead try to have special
snowflakes everywhere? </rant>
parent 49cd6f87
......@@ -251,6 +251,14 @@ module Redmine
def revisions
revisions ||= Revisions.new(collect{|entry| entry.lastrev}.compact)
end
# Required since Ruby 1.9.3 as the core compact always returns an
# instance of Array. This method follows the spec for Array#compact
def compact
ary = self.dup
ary.compact!
ary
end
end
class Info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment