activesearch 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
 - data/lib/activesearch/mongoid.rb +1 -1
 - data/lib/activesearch/version.rb +1 -1
 - data/spec/engines_spec.rb +4 -0
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                ZDRmYzczZTA2MjhjZGQ5NGYzOWVmOTdhOGI4NTg5YjkzZmVjNWI0MQ==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                MzAwZTIxNDE5MmFlNTZlOTQxYWI0YTEwM2U0MGZlMDU5YzllYWIyMw==
         
     | 
| 
       7 
7 
     | 
    
         
             
            !binary "U0hBNTEy":
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                NTRhMzQxMzU5ZmQ2NTkzOTI2NTE4M2I4NDAyMDJlY2VhODg1YjNjZDFiMGIy
         
     | 
| 
      
 10 
     | 
    
         
            +
                YjFiYmM4N2U4MDIyNTllOGZkZDczYjA0YmU3MGEzZTQxZDBmNTMwOTM4Zjk2
         
     | 
| 
      
 11 
     | 
    
         
            +
                OTg1YmNlNTQyYzdjZTkyNDg0NWZhYjgxZjMxNjdhODk4ZTJkNzQ=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                YzQ0YTQyNGQwY2VjMTg1ZDAyYjg3ZjJhYTJjZDQzZWM0ZWRiZTRkMWM5M2Zi
         
     | 
| 
      
 14 
     | 
    
         
            +
                M2Q3Mjc3NTNjOWFiMzIzYTM2M2ZhODllYjliMTJkYzVhNGJlMGM2ODEyMTY5
         
     | 
| 
      
 15 
     | 
    
         
            +
                YzdlN2IzYmU4ZmFhODZlNjk1MDNkNDQ1YjQxMTUxZDVkYTM1YTg=
         
     | 
    
        data/lib/activesearch/mongoid.rb
    CHANGED
    
    | 
         @@ -6,7 +6,7 @@ module ActiveSearch 
     | 
|
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
              def self.search(text, conditions = {})
         
     | 
| 
       8 
8 
     | 
    
         
             
                Proxy.new(text, conditions) do |text, conditions|
         
     | 
| 
       9 
     | 
    
         
            -
                  text = text.split(/\s+/)
         
     | 
| 
      
 9 
     | 
    
         
            +
                  text = text.downcase.split(/\s+/)
         
     | 
| 
       10 
10 
     | 
    
         
             
                  conditions.keys.each { |k| conditions["_stored.#{k}"] = conditions.delete(k) }
         
     | 
| 
       11 
11 
     | 
    
         
             
                  conditions.merge!(:_keywords.in => text + text.map { |word| "#{I18n.locale}:#{word}"})
         
     | 
| 
       12 
12 
     | 
    
         
             
                  Mongoid::Model.where(conditions)
         
     | 
    
        data/lib/activesearch/version.rb
    CHANGED
    
    
    
        data/spec/engines_spec.rb
    CHANGED
    
    | 
         @@ -53,6 +53,10 @@ Dir[File.join(File.dirname(__FILE__), 'models', '*.rb')].map { |f| File.basename 
     | 
|
| 
       53 
53 
     | 
    
         
             
                  ActiveSearch.search("some text").first.to_hash["title"].should == "Some title"
         
     | 
| 
       54 
54 
     | 
    
         
             
                  ActiveSearch.search("junk").first.to_hash["title"].should == "Junk"
         
     | 
| 
       55 
55 
     | 
    
         
             
                end
         
     | 
| 
      
 56 
     | 
    
         
            +
                
         
     | 
| 
      
 57 
     | 
    
         
            +
                it "should find docs even with upcase searches" do
         
     | 
| 
      
 58 
     | 
    
         
            +
                  ActiveSearch.search("FINDABLE").count.should == 4
         
     | 
| 
      
 59 
     | 
    
         
            +
                end
         
     | 
| 
       56 
60 
     | 
    
         | 
| 
       57 
61 
     | 
    
         
             
                it "should remove destroyed documents from index" do
         
     | 
| 
       58 
62 
     | 
    
         
             
                  @findable.destroy
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: activesearch
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.16
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Rodrigo Alvarez
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2013- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-05-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activesupport
         
     | 
| 
         @@ -201,3 +201,4 @@ test_files: 
     | 
|
| 
       201 
201 
     | 
    
         
             
            - spec/models/mongoid.rb
         
     | 
| 
       202 
202 
     | 
    
         
             
            - spec/mongoid_spec.rb
         
     | 
| 
       203 
203 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
      
 204 
     | 
    
         
            +
            has_rdoc: 
         
     |