<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,9 +1,20 @@
 require 'set'
 require 'will_paginate/array'
 
-## Everything below blatantly stolen from ActiveSupport  :o
+# helper to check for method existance in ruby 1.8- and 1.9-compatible way
+# because `methods`, `instance_methods` and others return strings in 1.8 and symbols in 1.9
+#
+#   ['foo', 'bar'].include_method?(:foo) # =&gt; true
+class Array
+  def include_method?(name)
+    name = name.to_sym
+    !!(find { |item| item.to_sym == name })
+  end
+end
+
+## everything below copied from ActiveSupport so we don't depend on it ##
 
-unless Hash.instance_methods.include? 'except'
+unless Hash.instance_methods.include_method? :except
   Hash.class_eval do
     # Returns a new hash without the given keys.
     def except(*keys)
@@ -18,7 +29,7 @@ unless Hash.instance_methods.include? 'except'
   end
 end
 
-unless Hash.instance_methods.include? 'slice'
+unless Hash.instance_methods.include_method? :slice
   Hash.class_eval do
     # Returns a new hash with only the given keys.
     def slice(*keys)
@@ -33,7 +44,7 @@ unless Hash.instance_methods.include? 'slice'
   end
 end
 
-unless String.instance_methods.include? 'constantize'
+unless String.instance_methods.include_method? :constantize
   String.class_eval do
     def constantize
       unless /\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/ =~ self
@@ -45,7 +56,7 @@ unless String.instance_methods.include? 'constantize'
   end
 end
 
-unless String.instance_methods.include? 'underscore'
+unless String.instance_methods.include_method? :underscore
   String.class_eval do
     def underscore
       self.to_s.gsub(/::/, '/').</diff>
      <filename>lib/will_paginate/core_ext.rb</filename>
    </modified>
    <modified>
      <diff>@@ -162,7 +162,7 @@ module WillPaginate::Finders
       
       # forget about includes if they are irrelevant (Rails 2.1)
       if count_options[:include] and
-          klass.private_methods.include?('references_eager_loaded_tables?') and
+          klass.private_methods.include_method?(:references_eager_loaded_tables?) and
           !klass.send(:references_eager_loaded_tables?, count_options)
         count_options.delete :include
       end</diff>
      <filename>lib/will_paginate/finders/active_record.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,10 @@ existing_methods = Sequel::Dataset::Pagination.instance_methods
 Sequel::Dataset::Pagination.module_eval do
   # it should quack like a WillPaginate::Collection
   
-  alias :total_pages   :page_count  unless existing_methods.include? 'total_pages'
-  alias :per_page      :page_size   unless existing_methods.include? 'per_page'
-  alias :previous_page :prev_page   unless existing_methods.include? 'previous_page'
-  alias :total_entries :pagination_record_count unless existing_methods.include? 'total_entries'
+  alias :total_pages   :page_count  unless existing_methods.include_method? :total_pages
+  alias :per_page      :page_size   unless existing_methods.include_method? :per_page
+  alias :previous_page :prev_page   unless existing_methods.include_method? :previous_page
+  alias :total_entries :pagination_record_count unless existing_methods.include_method? :total_entries
   
   def out_of_bounds?
     current_page &gt; total_pages</diff>
      <filename>lib/will_paginate/finders/sequel.rb</filename>
    </modified>
    <modified>
      <diff>@@ -236,7 +236,7 @@ describe WillPaginate::Finders::ActiveRecord do
     end
     
     # detect ActiveRecord 2.1
-    if ActiveRecord::Base.private_methods.include?('references_eager_loaded_tables?')
+    if ActiveRecord::Base.private_methods.include_method?(:references_eager_loaded_tables?)
       it &quot;should remove :include for count&quot; do
         Developer.expects(:find).returns([1])
         Developer.expects(:count).with({}).returns(0)</diff>
      <filename>spec/finders/active_record_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f7bd38629aa145834e6857eaef164cede3aad4aa</id>
    </parent>
  </parents>
  <author>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </author>
  <url>http://github.com/mislav/will_paginate/commit/ed6785b59ca76b4b70d6aef0053ff6fd1124521a</url>
  <id>ed6785b59ca76b4b70d6aef0053ff6fd1124521a</id>
  <committed-date>2009-05-20T02:39:40-07:00</committed-date>
  <authored-date>2009-05-20T01:08:54-07:00</authored-date>
  <message>check for method existance in a ruby 1.8- and 1.9-compatible way</message>
  <tree>dcceb3dd1e801b9ae7fb6d37e6a9a75ddf082a2c</tree>
  <committer>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </committer>
</commit>
