graphiti 1.2.12 → 1.2.13
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 +4 -4
 - data/.travis.yml +0 -5
 - data/lib/graphiti/adapters/active_record.rb +24 -5
 - data/lib/graphiti/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 96ec0914eb0786ee691d7b4610c8d94f47a8d852682c7b44ec69167391576d3d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ed446db0ab70384c1c87b079293b6c0f9ece23b25442649779c057360e4a86e0
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: bac579d3f12d400173eb4a3a14396e97dd7e14aa5fda6f6348679f7a8f9fd8969a373ef6201fc983b59258b73f395915a39df64d7a1c869bfea60c854c5f6459
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 85b01ba89239a712246f483f72c7661caf2c9bab5cc499f1e06a7c14ceb0218950a77b94e2c3492446500238315524baa8355e066f608d4770b72c91f2a45a3b
         
     | 
    
        data/.travis.yml
    CHANGED
    
    | 
         @@ -1,7 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            sudo: false
         
     | 
| 
       2 
2 
     | 
    
         
             
            language: ruby
         
     | 
| 
       3 
3 
     | 
    
         
             
            rvm:
         
     | 
| 
       4 
     | 
    
         
            -
            - 2.4
         
     | 
| 
       5 
4 
     | 
    
         
             
            - 2.5
         
     | 
| 
       6 
5 
     | 
    
         
             
            - 2.6
         
     | 
| 
       7 
6 
     | 
    
         
             
            gemfile:
         
     | 
| 
         @@ -39,10 +38,6 @@ matrix: 
     | 
|
| 
       39 
38 
     | 
    
         
             
                  gemfile: gemfiles/rails_5_graphiti_rails.gemfile
         
     | 
| 
       40 
39 
     | 
    
         
             
                - env: COMMAND=rspec
         
     | 
| 
       41 
40 
     | 
    
         
             
                  gemfile: gemfiles/rails_6_graphiti_rails.gemfile
         
     | 
| 
       42 
     | 
    
         
            -
                - gemfile: gemfiles/rails_6.gemfile
         
     | 
| 
       43 
     | 
    
         
            -
                  rvm: 2.4
         
     | 
| 
       44 
     | 
    
         
            -
                - gemfile: gemfiles/rails_6_graphiti_rails.gemfile
         
     | 
| 
       45 
     | 
    
         
            -
                  rvm: 2.4
         
     | 
| 
       46 
41 
     | 
    
         
             
                - gemfile: gemfiles/rails_4.gemfile
         
     | 
| 
       47 
42 
     | 
    
         
             
                  rvm: 2.5
         
     | 
| 
       48 
43 
     | 
    
         
             
                - gemfile: gemfiles/rails_4.gemfile
         
     | 
| 
         @@ -79,11 +79,30 @@ module Graphiti 
     | 
|
| 
       79 
79 
     | 
    
         
             
                    filter_string_suffix(scope, attribute, value, is_not: true)
         
     | 
| 
       80 
80 
     | 
    
         
             
                  end
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
     | 
    
         
            -
                   
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
                     
     | 
| 
      
 82 
     | 
    
         
            +
                  # Arel has different match escaping behavior before rails 5.
         
     | 
| 
      
 83 
     | 
    
         
            +
                  # Since rails 4.x does not expose methods to escape LIKE statements
         
     | 
| 
      
 84 
     | 
    
         
            +
                  # anyway, we just don't support proper LIKE escaping in those versions.
         
     | 
| 
      
 85 
     | 
    
         
            +
                  if ::ActiveRecord.version >= Gem::Version.new('5.0.0')
         
     | 
| 
      
 86 
     | 
    
         
            +
                    def filter_string_match(scope, attribute, value, is_not: false)
         
     | 
| 
      
 87 
     | 
    
         
            +
                      escape_char = '\\'
         
     | 
| 
      
 88 
     | 
    
         
            +
                      column = column_for(scope, attribute)
         
     | 
| 
      
 89 
     | 
    
         
            +
                      map = value.map do |v|
         
     | 
| 
      
 90 
     | 
    
         
            +
                        v = v.downcase
         
     | 
| 
      
 91 
     | 
    
         
            +
                        v = scope.sanitize_sql_like(v)
         
     | 
| 
      
 92 
     | 
    
         
            +
                        "%#{v}%"
         
     | 
| 
      
 93 
     | 
    
         
            +
                      end
         
     | 
| 
      
 94 
     | 
    
         
            +
                      clause = column.lower.matches_any(map, escape_char, true)
         
     | 
| 
      
 95 
     | 
    
         
            +
                      is_not ? scope.where.not(clause) : scope.where(clause)
         
     | 
| 
      
 96 
     | 
    
         
            +
                    end
         
     | 
| 
      
 97 
     | 
    
         
            +
                  else
         
     | 
| 
      
 98 
     | 
    
         
            +
                    def filter_string_match(scope, attribute, value, is_not: false)
         
     | 
| 
      
 99 
     | 
    
         
            +
                      column = column_for(scope, attribute)
         
     | 
| 
      
 100 
     | 
    
         
            +
                      map = value.map do |v|
         
     | 
| 
      
 101 
     | 
    
         
            +
                        "%#{v.downcase}%"
         
     | 
| 
      
 102 
     | 
    
         
            +
                      end
         
     | 
| 
      
 103 
     | 
    
         
            +
                      clause = column.lower.matches_any(map)
         
     | 
| 
      
 104 
     | 
    
         
            +
                      is_not ? scope.where.not(clause) : scope.where(clause)
         
     | 
| 
      
 105 
     | 
    
         
            +
                    end
         
     | 
| 
       87 
106 
     | 
    
         
             
                  end
         
     | 
| 
       88 
107 
     | 
    
         | 
| 
       89 
108 
     | 
    
         
             
                  def filter_string_not_match(scope, attribute, value)
         
     | 
    
        data/lib/graphiti/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: graphiti
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.2.13
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Lee Richmond
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-01-08 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: jsonapi-serializable
         
     |