<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,5 @@
 .DS_Store
-scoped_search-*.gem
+*scoped_search-*.gem
 /tmp
 /doc
 /pkg</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -44,9 +44,7 @@ module ScopedSearch
       search_conditions.each_with_index do |search_condition, index|
         keyword_name = &quot;keyword_#{index}&quot;.to_sym
         conditions &lt;&lt; case search_condition.last
-                        # Still thinking about this one
-                        # when :integer: integer_conditions(keyword_name, search_condition.first)
-          
+                        # :like also handles integers
                         when :like: like_condition(keyword_name, search_condition.first)
                         when :not: not_like_condition(keyword_name, search_condition.first)
             
@@ -68,17 +66,18 @@ module ScopedSearch
     
     private 
     
-    # def integer_condition(keyword_name, value)
-      # Still thinking about this one
-    # end    
-    
-    def like_condition(keyword_name, value)
-      @query_params[keyword_name] = &quot;%#{value}%&quot;
+    def like_condition(keyword_name, value)      
       retVal = []
       @query_fields.each do |field, field_type|  #|key,value| 
         if field_type == :string or field_type == :text
+          @query_params[keyword_name] = &quot;%#{value}%&quot;
           retVal &lt;&lt; &quot;#{field} #{@sql_like} :#{keyword_name.to_s}&quot;
         end
+        if value.strip =~ /^[0-9]+$/ and (field_type == :int or field_type == :integer)
+          qkey = &quot;#{keyword_name}_#{value.strip}&quot;
+          @query_params[qkey.to_sym] = value.strip.to_i
+          retVal &lt;&lt; &quot;#{field} = :#{qkey}&quot;
+        end
       end
       &quot;(#{retVal.join(' OR ')})&quot;
     end
@@ -101,10 +100,22 @@ module ScopedSearch
       keyword_name_b = &quot;#{keyword_name.to_s}b&quot;.to_sym
       @query_params[keyword_name_a] = &quot;%#{word1}%&quot;
       @query_params[keyword_name_b] = &quot;%#{word2}%&quot;      
-      @query_fields.each do |field, field_type|  #|key,value| 
+      @query_fields.each do |field, field_type|  #|key,value|       
         if field_type == :string or field_type == :text
           retVal &lt;&lt; &quot;(#{field} #{@sql_like} :#{keyword_name_a.to_s} OR #{field} #{@sql_like} :#{keyword_name_b.to_s})&quot;
         end
+        if (word1.strip =~ /^[0-9]+$/ and word2.strip =~ /^[0-9]+$/) and (field_type == :int or field_type == :integer)
+          qkeya = &quot;#{keyword_name}_a_#{word1.strip}&quot;
+          qkeyb = &quot;#{keyword_name}_b_#{word2.strip}&quot;
+          @query_params[qkeya] = word1.strip.to_i
+          @query_params[qkeyb] = word2.strip.to_i
+          retVal &lt;&lt; &quot;(#{field} = :#{qkeya} OR #{field} = :#{qkeyb})&quot;   
+        elsif (word1.strip =~ /^[0-9]+$/ or word2.strip =~ /^[0-9]+$/) and (field_type == :int or field_type == :integer)
+          num_word = word1.strip =~ /^[0-9]+$/ ? word1.strip.to_i : word2.strip.to_i
+          qkey = &quot;#{keyword_name}_#{num_word}&quot;
+          @query_params[qkey.to_sym] = num_word
+          retVal &lt;&lt; &quot;(#{field} = :#{qkey})&quot;
+        end             
       end 
       &quot;(#{retVal.join(' OR ')})&quot;     
     end</diff>
      <filename>lib/scoped_search/query_conditions_builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,7 +69,7 @@ module ScopedSearch
             end
         end
       end
-      
+
       return conditions_tree
     end
     </diff>
      <filename>lib/scoped_search/query_language_parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 Gem::Specification.new do |s|
   s.name    = 'scoped_search'
-  s.version = '1.0.1'
+  s.version = '1.1.0'
   s.date    = '2009-01-29'
   
   s.summary = &quot;A Rails plugin to search your models using a named_scope&quot;</diff>
      <filename>scoped_search.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -35,10 +35,11 @@ class ScopedSearch::Test::API &lt; Test::Unit::TestCase
   def test_search_except_fields
     Foo.searchable_on :except =&gt; [:id, :ignored_field, :created_at, :updated_at]
     assert Foo.respond_to?(:search_for)
-    assert_equal Foo.scoped_search_fields.size, 3
+    assert_equal Foo.scoped_search_fields.size, 4
     assert Foo.scoped_search_fields.include?(:string_field)
     assert Foo.scoped_search_fields.include?(:text_field)
     assert Foo.scoped_search_fields.include?(:date_field)
+    assert Foo.scoped_search_fields.include?(:some_int_field)
   end  
   
   def test_search_with_only_and_except</diff>
      <filename>test/integration/api_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,22 +2,22 @@ module ScopedSearch::Test::Models
     
   class Foo &lt; ActiveRecord::Base
     def self.create_corpus!
-      create!(:string_field =&gt; &quot;Programmer 123&quot;, :text_field =&gt; nil,              :ignored_field =&gt; &quot;123456&quot;,  :date_field =&gt; '2000-01-01')    
-      create!(:string_field =&gt; &quot;Jim&quot;,            :text_field =&gt; &quot;Henson&quot;,         :ignored_field =&gt; &quot;123456a&quot;, :date_field =&gt; '2001-04-15')   
-      create!(:string_field =&gt; &quot;Jim&quot;,            :text_field =&gt; &quot;Bush&quot;,           :ignored_field =&gt; &quot;123456b&quot;, :date_field =&gt; '2001-04-17')    
-      create!(:string_field =&gt; &quot;Wes&quot;,            :text_field =&gt; &quot;Hays&quot;,           :ignored_field =&gt; &quot;123456c&quot;, :date_field =&gt; '1980-09-27')  
-      create!(:string_field =&gt; &quot;Bob&quot;,            :text_field =&gt; &quot;Hays&quot;,           :ignored_field =&gt; &quot;123456d&quot;, :date_field =&gt; '2002-11-09')  
-      create!(:string_field =&gt; &quot;Dogs&quot;,           :text_field =&gt; &quot;Pit Bull&quot;,       :ignored_field =&gt; &quot;123456e&quot;, :date_field =&gt; '2002-12-26') 
-      create!(:string_field =&gt; &quot;Dogs&quot;,           :text_field =&gt; &quot;Eskimo&quot;,         :ignored_field =&gt; &quot;123456f&quot;, :date_field =&gt; '2003-03-19')
-      create!(:string_field =&gt; &quot;Cows&quot;,           :text_field =&gt; &quot;Farms&quot;,          :ignored_field =&gt; &quot;123456g&quot;, :date_field =&gt; '2004-05-01')
-      create!(:string_field =&gt; &quot;Hello World&quot;,    :text_field =&gt; &quot;Hello Moon&quot;,     :ignored_field =&gt; &quot;123456h&quot;, :date_field =&gt; '2004-07-11')   
-      create!(:string_field =&gt; &quot;Hello World&quot;,    :text_field =&gt; &quot;Goodnight Moon&quot;, :ignored_field =&gt; &quot;123456i&quot;, :date_field =&gt; '2004-09-12')
-      create!(:string_field =&gt; &quot;Happy Cow&quot;,      :text_field =&gt; &quot;Sad Cow&quot;,        :ignored_field =&gt; &quot;123456j&quot;, :date_field =&gt; '2005-02-05')
-      create!(:string_field =&gt; &quot;Happy Frog&quot;,     :text_field =&gt; &quot;Sad Frog&quot;,       :ignored_field =&gt; &quot;123456k&quot;, :date_field =&gt; '2006-03-09')
-      create!(:string_field =&gt; &quot;Excited Frog&quot;,   :text_field =&gt; &quot;Sad Frog&quot;,       :ignored_field =&gt; &quot;123456l&quot;, :date_field =&gt; '2006-07-15')    
-      create!(:string_field =&gt; &quot;Man made&quot;,       :text_field =&gt; &quot;Woman made&quot;,     :ignored_field =&gt; &quot;123456m&quot;, :date_field =&gt; '2007-06-13')
-      create!(:string_field =&gt; &quot;Cat Toys&quot;,       :text_field =&gt; &quot;Frog Toys&quot;,      :ignored_field =&gt; &quot;123456n&quot;, :date_field =&gt; '2008-03-04') 
-      create!(:string_field =&gt; &quot;Happy Toys&quot;,     :text_field =&gt; &quot;Sad Toys&quot;,       :ignored_field =&gt; &quot;123456n&quot;, :date_field =&gt; '2008-05-12') 
+      create!(:string_field =&gt; &quot;Programmer 123&quot;, :text_field =&gt; nil,              :ignored_field =&gt; &quot;123456&quot;,  :some_int_field =&gt; 111, :date_field =&gt; '2000-01-01')    
+      create!(:string_field =&gt; &quot;Jim&quot;,            :text_field =&gt; &quot;Henson&quot;,         :ignored_field =&gt; &quot;123456a&quot;, :some_int_field =&gt; 222, :date_field =&gt; '2001-04-15')   
+      create!(:string_field =&gt; &quot;Jim&quot;,            :text_field =&gt; &quot;Bush&quot;,           :ignored_field =&gt; &quot;123456b&quot;, :some_int_field =&gt; 333, :date_field =&gt; '2001-04-17')    
+      create!(:string_field =&gt; &quot;Wes&quot;,            :text_field =&gt; &quot;Hays&quot;,           :ignored_field =&gt; &quot;123456c&quot;, :some_int_field =&gt; 444, :date_field =&gt; '1980-09-27')  
+      create!(:string_field =&gt; &quot;Bob&quot;,            :text_field =&gt; &quot;Hays&quot;,           :ignored_field =&gt; &quot;123456d&quot;, :some_int_field =&gt; 555, :date_field =&gt; '2002-11-09')  
+      create!(:string_field =&gt; &quot;Dogs&quot;,           :text_field =&gt; &quot;Pit Bull&quot;,       :ignored_field =&gt; &quot;123456e&quot;, :some_int_field =&gt; 666, :date_field =&gt; '2002-12-26') 
+      create!(:string_field =&gt; &quot;Dogs&quot;,           :text_field =&gt; &quot;Eskimo&quot;,         :ignored_field =&gt; &quot;123456f&quot;, :some_int_field =&gt; 777, :date_field =&gt; '2003-03-19')
+      create!(:string_field =&gt; &quot;Cows&quot;,           :text_field =&gt; &quot;Farms&quot;,          :ignored_field =&gt; &quot;123456g&quot;, :some_int_field =&gt; 888, :date_field =&gt; '2004-05-01')
+      create!(:string_field =&gt; &quot;Hello World&quot;,    :text_field =&gt; &quot;Hello Moon&quot;,     :ignored_field =&gt; &quot;123456h&quot;, :some_int_field =&gt; 999, :date_field =&gt; '2004-07-11')   
+      create!(:string_field =&gt; &quot;Hello World&quot;,    :text_field =&gt; &quot;Goodnight Moon&quot;, :ignored_field =&gt; &quot;123456i&quot;, :some_int_field =&gt; 100, :date_field =&gt; '2004-09-12')
+      create!(:string_field =&gt; &quot;Happy Cow&quot;,      :text_field =&gt; &quot;Sad Cow&quot;,        :ignored_field =&gt; &quot;123456j&quot;, :some_int_field =&gt; 200, :date_field =&gt; '2005-02-05')
+      create!(:string_field =&gt; &quot;Happy Frog&quot;,     :text_field =&gt; &quot;Sad Frog&quot;,       :ignored_field =&gt; &quot;123456k&quot;, :some_int_field =&gt; 300, :date_field =&gt; '2006-03-09')
+      create!(:string_field =&gt; &quot;Excited Frog&quot;,   :text_field =&gt; &quot;Sad Frog&quot;,       :ignored_field =&gt; &quot;123456l&quot;, :some_int_field =&gt; 400, :date_field =&gt; '2006-07-15')    
+      create!(:string_field =&gt; &quot;Man made&quot;,       :text_field =&gt; &quot;Woman made&quot;,     :ignored_field =&gt; &quot;123456m&quot;, :some_int_field =&gt; 500, :date_field =&gt; '2007-06-13')
+      create!(:string_field =&gt; &quot;Cat Toys&quot;,       :text_field =&gt; &quot;Frog Toys&quot;,      :ignored_field =&gt; &quot;123456n&quot;, :some_int_field =&gt; 600, :date_field =&gt; '2008-03-04') 
+      create!(:string_field =&gt; &quot;Happy Toys&quot;,     :text_field =&gt; &quot;Sad Toys&quot;,       :ignored_field =&gt; &quot;123456n&quot;, :some_int_field =&gt; 700, :date_field =&gt; '2008-05-12') 
 
       create!(:string_field =&gt; &quot;My son was born on 7/15/2006 and weighed 5.5 lbs&quot;,     
               :text_field =&gt; &quot;Sad Toys&quot;,       
@@ -36,11 +36,11 @@ module ScopedSearch::Test::Models
     has_many :clients, :through =&gt; :offices
     
     def self.create_corpus!
-      create!(:first_name =&gt; 'Willem',  :last_name =&gt; 'Van Bergen', :login =&gt; 'wvanbergen', :group_id =&gt; 1, :address_id =&gt; 1) 
-      create!(:first_name =&gt; 'Wes',     :last_name =&gt; 'Hays',       :login =&gt; 'weshays',    :group_id =&gt; 1, :address_id =&gt; 2) 
-      create!(:first_name =&gt; 'John',    :last_name =&gt; 'Dell',       :login =&gt; 'jdell',      :group_id =&gt; 2, :address_id =&gt; 3) 
-      create!(:first_name =&gt; 'Ray',     :last_name =&gt; 'York',       :login =&gt; 'ryork',      :group_id =&gt; 3, :address_id =&gt; 4) 
-      create!(:first_name =&gt; 'Anna',    :last_name =&gt; 'Landis',     :login =&gt; 'alandis',    :group_id =&gt; 4, :address_id =&gt; 5) 
+      create!(:first_name =&gt; 'Willem',  :last_name =&gt; 'Van Bergen', :login =&gt; 'wvanbergen', :age =&gt; 25, :group_id =&gt; 1, :address_id =&gt; 1) 
+      create!(:first_name =&gt; 'Wes',     :last_name =&gt; 'Hays',       :login =&gt; 'weshays',    :age =&gt; 26, :group_id =&gt; 1, :address_id =&gt; 2) 
+      create!(:first_name =&gt; 'John',    :last_name =&gt; 'Dell',       :login =&gt; 'jdell',      :age =&gt; 27, :group_id =&gt; 2, :address_id =&gt; 3) 
+      create!(:first_name =&gt; 'Ray',     :last_name =&gt; 'York',       :login =&gt; 'ryork',      :age =&gt; 28, :group_id =&gt; 3, :address_id =&gt; 4) 
+      create!(:first_name =&gt; 'Anna',    :last_name =&gt; 'Landis',     :login =&gt; 'alandis',    :age =&gt; 29, :group_id =&gt; 4, :address_id =&gt; 5) 
     
       user = self.find_by_first_name('Willem')
       user.locations &lt;&lt; ScopedSearch::Test::Models::Location.find_by_name('Office')</diff>
      <filename>test/lib/test_models.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,12 +8,14 @@ class ScopedSearch::Test::DatabaseSchema &lt; ActiveRecord::Migration
       t.string :string_field
       t.text :text_field
       t.string :ignored_field
+      t.integer :some_int_field
       t.date :date_field
       t.timestamps
     end
     
     create_table :users do |t|
       t.string :first_name, :last_name, :login
+      t.integer :age
       t.integer :group_id
       t.integer :address_id
     end   </diff>
      <filename>test/lib/test_schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,15 @@ class ScopedSearch::Test::QueryConditionsBuilder &lt; Test::Unit::TestCase
     assert_equal '%Wes%', conditions.last[:keyword_0]
   end
   
+  def test_like_search_condition_with_integer
+    search_conditions = [[&quot;26&quot;, :like]]
+    query_fields = {'some_table.age' =&gt; :integer}    
+    conditions = build_query(search_conditions, query_fields) 
+  
+    assert_equal '(some_table.age = :keyword_0_26)', conditions.first
+    assert_equal 26, conditions.last[:keyword_0_26]
+  end  
+  
   def test_not_like_search_condition
     search_conditions = [[&quot;Wes&quot;, :not]]
     query_fields = {'some_table.first_name' =&gt; :string}    
@@ -54,6 +63,16 @@ class ScopedSearch::Test::QueryConditionsBuilder &lt; Test::Unit::TestCase
     assert_equal '%Hays%', conditions.last[:keyword_0b]
   end
   
+  def test_or_search_condition_with_integer
+    search_conditions = [[&quot;Wes OR 26&quot;, :or]]
+    query_fields = {'some_table.first_name' =&gt; :string, 'some_table.age' =&gt; :integer}    
+    conditions = build_query(search_conditions, query_fields) 
+    regExs = build_regex_for_or(['first_name', 'age'], 'keyword_0')
+    assert_match /^#{regExs}$/, conditions.first
+    assert_equal '%Wes%', conditions.last[:keyword_0a]
+    assert_equal 26, conditions.last[:keyword_0_26]       
+  end  
+  
   # ** less_than_date **
   def test_less_than_date_search_condition_with_only_a_date_field_to_search 
     search_conditions = [['&lt; 09/27/1980', :less_than_date]]
@@ -374,12 +393,13 @@ class ScopedSearch::Test::QueryConditionsBuilder &lt; Test::Unit::TestCase
   def build_regex_for_or(fields,keyword)
     orFields = fields.join('|')
     regParts = fields.collect { |field| 
-                 &quot;[\(]some_table.(#{orFields}) LIKE :#{keyword}a OR some_table.(#{orFields}) LIKE :#{keyword}b[\)]&quot; 
+                 &quot;([(](some_table.(first_name|age) (LIKE|=) :keyword_0[a-zA-Z0-9_]+ OR )?some_table.(first_name|age) (LIKE|=) :keyword_0[a-zA-Z0-9_]+)[)]&quot; 
                }.join('[ ]OR[ ]')
     
     &quot;[\(]#{regParts}[\)]&quot;
   end  
   
+  
   def build_regex_for_date(fields,keyword)
     orFields = fields.join('|')
     regParts = fields.collect { |field| </diff>
      <filename>test/unit/query_conditions_builder_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,12 +30,13 @@ class ScopedSearch::Test::QueryLanguage &lt; Test::Unit::TestCase
     assert_equal 2, parsed.length
     assert_equal 'willem', parsed.last.first
     
-    parsed = parse_query(&quot;  hallo  willem   van\tbergen &quot;)
-    assert_equal 4, parsed.length    
+    parsed = parse_query(&quot;  hallo  willem   van\tbergen 25&quot;)
+    assert_equal 5, parsed.length    
     assert_equal 'hallo',  parsed[0].first
     assert_equal 'willem', parsed[1].first
     assert_equal 'van',    parsed[2].first
     assert_equal 'bergen', parsed[3].first      
+    assert_equal '25',     parsed[4].first
   end
   
   def test_quoted_keywords
@@ -56,6 +57,10 @@ class ScopedSearch::Test::QueryLanguage &lt; Test::Unit::TestCase
     assert_equal 2, parsed.length
     assert_equal 'hallo wi', parsed[0].first
     assert_equal 'llem',       parsed[1].first
+    
+    parsed = parse_query('&quot;hays 25&quot;')
+    assert_equal 1, parsed.length
+    assert_equal 'hays 25', parsed[0].first  
   end
   
   def test_quote_escaping</diff>
      <filename>test/unit/query_language_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ class ScopedSearch::Test::SearchFor &lt; Test::Unit::TestCase
   end
   
   def test_search
-    Foo.searchable_on :string_field, :text_field, :date_field
+    Foo.searchable_on :string_field, :text_field, :date_field, :some_int_field
   
     assert_equal Foo.count, Foo.search_for('').count
     assert_equal 0, Foo.search_for('456').count   
@@ -32,6 +32,7 @@ class ScopedSearch::Test::SearchFor &lt; Test::Unit::TestCase
     assert_equal 3, Foo.search_for('&quot;Happy cow&quot; OR &quot;Sad Frog&quot;').count
     assert_equal 3, Foo.search_for('&quot;Man made&quot; OR Dogs').count
     assert_equal 2, Foo.search_for('Cows OR &quot;Frog Toys&quot;').count   
+    assert_equal 1, Foo.search_for('700').count
   
     # ** DATES **   
     #
@@ -83,12 +84,13 @@ class ScopedSearch::Test::SearchFor &lt; Test::Unit::TestCase
   end  
   
   def test_search_has_many_through_association
-    User.searchable_on :first_name, :last_name, :clients_first_name, :clients_last_name
+    User.searchable_on :first_name, :last_name, :age, :clients_first_name, :clients_last_name
       
     assert_equal User.count, User.search_for('').count        
     assert_equal 2, User.search_for('Smith').count     
     assert_equal 1, User.search_for('Sam').count
     assert_equal 1, User.search_for('Johnson').count
+    assert_equal 1, User.search_for('28').count
   end  
   
   def test_search_has_one_association</diff>
      <filename>test/unit/search_for_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fd0392adf25b3ffaf815a44dc4a3dd8ae3569efa</id>
    </parent>
  </parents>
  <author>
    <name>Wes Hays</name>
    <email>weshays@gbdev.com</email>
  </author>
  <url>http://github.com/wvanbergen/scoped_search/commit/13cce4b70e9b48178c90686109e16cac1d7855e3</url>
  <id>13cce4b70e9b48178c90686109e16cac1d7855e3</id>
  <committed-date>2009-02-23T12:14:44-08:00</committed-date>
  <authored-date>2009-02-23T12:14:44-08:00</authored-date>
  <message>Added support for integer|int fields</message>
  <tree>f2dcd9bd06e90d257992d75384c45a767076ea67</tree>
  <committer>
    <name>Wes Hays</name>
    <email>weshays@gbdev.com</email>
  </committer>
</commit>
