Undev/redmine-stuff-to-do-plugin

View on GitHub
lib/stuff_to_do_array_patch.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Array
  # converts an array to a hash with the key = index in Array
  def to_hash
    Hash[*self.collect {|v|
           [self.index(v),v]
         }.flatten]
  end unless respond_to?(:to_hash)
end