graphiti 1.0.beta.19 → 1.0.beta.20
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/lib/graphiti/scoping/filter.rb +14 -1
 - data/lib/graphiti/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 9ac056ea53da51436d7397f5e70165e5a5b0d4f0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c30c9910b949040f7d4ebe0bd2c8fa64a0f45e61
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 1ce89753aaca2ea2d2740551085a42b7be139269f8e4e8d03815270c962484cda25e868548dc9058278f2cf8e8a54faa5541df16356f29e20784df24ea6329fc
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: e9101c3dbf5814b975d4ddd3199e5153750649e6c0dd4303a60c68703c2759904629a55bc4c71ae79c88b97057c11fff974a91ea2d12c28bf7181c04d00ceee0
         
     | 
| 
         @@ -48,7 +48,9 @@ module Graphiti 
     | 
|
| 
       48 
48 
     | 
    
         
             
                    value, operator = normalize_param(filter, param_value)
         
     | 
| 
       49 
49 
     | 
    
         
             
                    operator = operator.to_s.gsub('!', 'not_').to_sym
         
     | 
| 
       50 
50 
     | 
    
         
             
                    validate_operator(filter, operator)
         
     | 
| 
       51 
     | 
    
         
            -
                     
     | 
| 
      
 51 
     | 
    
         
            +
                    unless filter.values[0][:type] == :hash || !value.is_a?(String)
         
     | 
| 
      
 52 
     | 
    
         
            +
                      value = parse_string_value(filter.values[0], value)
         
     | 
| 
      
 53 
     | 
    
         
            +
                    end
         
     | 
| 
       52 
54 
     | 
    
         
             
                    validate_singular(resource, filter, value)
         
     | 
| 
       53 
55 
     | 
    
         
             
                    value = coerce_types(filter.values[0], param_name.to_sym, value)
         
     | 
| 
       54 
56 
     | 
    
         
             
                    validate_allowlist(resource, filter, value)
         
     | 
| 
         @@ -130,6 +132,17 @@ module Graphiti 
     | 
|
| 
       130 
132 
     | 
    
         | 
| 
       131 
133 
     | 
    
         
             
                  if value.is_a?(String)
         
     | 
| 
       132 
134 
     | 
    
         
             
                    value = value.gsub('{{{', '{').gsub('}}}', '}')
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
                    # Accomodate array of hashes
         
     | 
| 
      
 137 
     | 
    
         
            +
                    if value.include?('},{')
         
     | 
| 
      
 138 
     | 
    
         
            +
                      value = value.split('},{').map do |v|
         
     | 
| 
      
 139 
     | 
    
         
            +
                        if v.starts_with?('{') && !v.ends_with?('}')
         
     | 
| 
      
 140 
     | 
    
         
            +
                          v = "#{v}}"
         
     | 
| 
      
 141 
     | 
    
         
            +
                        elsif v.ends_with?('}') && !v.starts_with?('{')
         
     | 
| 
      
 142 
     | 
    
         
            +
                          v = "{#{v}"
         
     | 
| 
      
 143 
     | 
    
         
            +
                        end
         
     | 
| 
      
 144 
     | 
    
         
            +
                      end
         
     | 
| 
      
 145 
     | 
    
         
            +
                    end
         
     | 
| 
       133 
146 
     | 
    
         
             
                  end
         
     | 
| 
       134 
147 
     | 
    
         | 
| 
       135 
148 
     | 
    
         
             
                  [value, operator]
         
     | 
    
        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.0.beta. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.beta.20
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Lee Richmond
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2018-12- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-12-17 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: jsonapi-serializable
         
     |