Skip to content

Instantly share code, notes, and snippets.

@hannestyden
Created December 9, 2009 11:24
Show Gist options
  • Save hannestyden/252414 to your computer and use it in GitHub Desktop.
Save hannestyden/252414 to your computer and use it in GitHub Desktop.
Suggestion for ActiveSupport::CoreExtensions::Array::Conversions
module ActiveSupport::CoreExtensions::Array::Conversions
def to_ordered_hash
self.inject(ActiveSupport::OrderedHash.new) do |ordered_hash, (key, value)|
ordered_hash[key] = value
ordered_hash
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment