Skip to content

Commit

Permalink
Namespacing issue with Hash, now #slice works fine [mislav#17 state:r…
Browse files Browse the repository at this point in the history
…esolved]

git-svn-id: svn://errtheblog.com/svn/plugins/will_paginate@223 1eaa51fe-a21a-0410-9c2e-ae7a00a434c4
  • Loading branch information
mislav committed May 18, 2007
1 parent e03e3bf commit 8cc61c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init.rb
@@ -1,8 +1,8 @@
ActiveRecord::Base.send :include, WillPaginate::Finder
ActionView::Base.send :include, WillPaginate::ViewHelpers

unless Hash.new.respond_to? :slice
class Hash
unless ::Hash.new.respond_to? :slice
class ::Hash
# Returns a new hash with only the given keys.
def slice(*keys)
allowed = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys)
Expand Down

0 comments on commit 8cc61c8

Please sign in to comment.