query_string_interface 0.4.0 → 0.4.1
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.
| @@ -52,14 +52,22 @@ module QueryStringInterface | |
| 52 52 |  | 
| 53 53 | 
             
                  def optimized_filter_parsers
         | 
| 54 54 | 
             
                    if or_filter_parser
         | 
| 55 | 
            -
                       | 
| 56 | 
            -
                         | 
| 57 | 
            -
                           | 
| 58 | 
            -
                        else
         | 
| 59 | 
            -
                          result << filter_parser
         | 
| 55 | 
            +
                      if or_filter_parser.value.is_a?(Array) && or_filter_parser.value.count == 1
         | 
| 56 | 
            +
                        or_inner_filters = or_filter_parser.value.first.with_indifferent_access.map do |raw_attribute, raw_value|
         | 
| 57 | 
            +
                          Filter.new(raw_attribute, raw_value, @attributes_to_replace, @raw_filters)
         | 
| 60 58 | 
             
                        end
         | 
| 59 | 
            +
                        filter_parsers.delete(or_filter_parser)
         | 
| 60 | 
            +
                        filter_parsers + or_inner_filters
         | 
| 61 | 
            +
                      else
         | 
| 62 | 
            +
                        filter_parsers.inject([]) do |result, filter_parser|
         | 
| 63 | 
            +
                          if filter_parser != or_filter_parser && or_filter_parser.include?(filter_parser)
         | 
| 64 | 
            +
                            or_filter_parser.merge(filter_parser)
         | 
| 65 | 
            +
                          else
         | 
| 66 | 
            +
                            result << filter_parser
         | 
| 67 | 
            +
                          end
         | 
| 61 68 |  | 
| 62 | 
            -
             | 
| 69 | 
            +
                          result
         | 
| 70 | 
            +
                        end
         | 
| 63 71 | 
             
                      end
         | 
| 64 72 | 
             
                    else
         | 
| 65 73 | 
             
                      filter_parsers
         | 
    
        metadata
    CHANGED
    
    | @@ -2,7 +2,7 @@ | |
| 2 2 | 
             
            name: query_string_interface
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 4 | 
             
              prerelease: 
         | 
| 5 | 
            -
              version: 0.4. | 
| 5 | 
            +
              version: 0.4.1
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors: 
         | 
| 8 8 | 
             
            - Vicente Mundim
         | 
| @@ -10,7 +10,7 @@ autorequire: | |
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 12 |  | 
| 13 | 
            -
            date: 2012- | 
| 13 | 
            +
            date: 2012-04-20 00:00:00 Z
         | 
| 14 14 | 
             
            dependencies: 
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 16 16 | 
             
              name: activesupport
         | 
| @@ -44,18 +44,18 @@ extensions: [] | |
| 44 44 | 
             
            extra_rdoc_files: []
         | 
| 45 45 |  | 
| 46 46 | 
             
            files: 
         | 
| 47 | 
            -
            - lib/query_string_interface | 
| 48 | 
            -
            - lib/query_string_interface/filter_collection.rb
         | 
| 49 | 
            -
            - lib/query_string_interface/helpers.rb
         | 
| 47 | 
            +
            - lib/query_string_interface.rb
         | 
| 50 48 | 
             
            - lib/query_string_interface/parsers/array_parser.rb
         | 
| 51 | 
            -
            - lib/query_string_interface/parsers/boolean_and_nil_parser.rb
         | 
| 52 49 | 
             
            - lib/query_string_interface/parsers/date_time_parser.rb
         | 
| 53 50 | 
             
            - lib/query_string_interface/parsers/number_parser.rb
         | 
| 51 | 
            +
            - lib/query_string_interface/parsers/boolean_and_nil_parser.rb
         | 
| 54 52 | 
             
            - lib/query_string_interface/parsers/regex_parser.rb
         | 
| 53 | 
            +
            - lib/query_string_interface/version.rb
         | 
| 54 | 
            +
            - lib/query_string_interface/filter_collection.rb
         | 
| 55 | 
            +
            - lib/query_string_interface/filter.rb
         | 
| 56 | 
            +
            - lib/query_string_interface/helpers.rb
         | 
| 55 57 | 
             
            - lib/query_string_interface/parsers.rb
         | 
| 56 58 | 
             
            - lib/query_string_interface/sorting_filters.rb
         | 
| 57 | 
            -
            - lib/query_string_interface/version.rb
         | 
| 58 | 
            -
            - lib/query_string_interface.rb
         | 
| 59 59 | 
             
            - MIT_LICENSE
         | 
| 60 60 | 
             
            - README.md
         | 
| 61 61 | 
             
            - Gemfile
         |