postjob 0.5.0 → 0.5.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.
- checksums.yaml +4 -4
- data/lib/postjob/queue/search.rb +7 -9
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5166951ca6511e2d599b44493288dc1ac43f712a
         | 
| 4 | 
            +
              data.tar.gz: f32f0a3255c782e5998d8c77b68b8e5656f356ae
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 40f67bc7082fc9df09bda3c4425297ffa7ce6ddaed0feef2bb849a3b9e5773a06a6b5349972c8f5c8f0d5c7cefb4cc7b1e0f64ce8da336d52fa0239a5e45fde1
         | 
| 7 | 
            +
              data.tar.gz: d5928e359abfc51dbeab4a1054d435dbba799ba5107296ccd2b65494e2c9853fca350ab88eba9f291ead1736026b74e04371d6830afad77a8b08bb60020a1ed8
         | 
    
        data/lib/postjob/queue/search.rb
    CHANGED
    
    | @@ -40,7 +40,9 @@ module Postjob::Queue | |
| 40 40 | 
             
                end
         | 
| 41 41 |  | 
| 42 42 | 
             
                converted_filters = filter.inject({}) do |hsh, (key, value)|
         | 
| 43 | 
            -
                   | 
| 43 | 
            +
                  matches = convert_filter_value(value, key: key)
         | 
| 44 | 
            +
                  matches = matches.first if matches.length == 1
         | 
| 45 | 
            +
                  hsh.update key => matches
         | 
| 44 46 | 
             
                end
         | 
| 45 47 |  | 
| 46 48 | 
             
                column_filters, tags_filters = converted_filters.partition { |key, _| !column_types[key].nil? }
         | 
| @@ -71,14 +73,10 @@ module Postjob::Queue | |
| 71 73 | 
             
                value = Array(value)
         | 
| 72 74 |  | 
| 73 75 | 
             
                case Postjob::Queue.column_types[key]
         | 
| 74 | 
            -
                when "bigint"   then  | 
| 75 | 
            -
                when "integer"  then  | 
| 76 | 
            -
                when nil        then  | 
| 77 | 
            -
                else                  | 
| 76 | 
            +
                when "bigint"   then value.map { |v| Integer(v) }
         | 
| 77 | 
            +
                when "integer"  then value.map { |v| Integer(v) }
         | 
| 78 | 
            +
                when nil        then value.map(&:to_s) + value.grep(/\A-?\d+\z/).map(&:to_i)
         | 
| 79 | 
            +
                else                 value.map(&:to_s)
         | 
| 78 80 | 
             
                end
         | 
| 79 81 | 
             
              end
         | 
| 80 | 
            -
             | 
| 81 | 
            -
              def simplify_array(ary)
         | 
| 82 | 
            -
                ary.length == 1 ? ary.first : ary
         | 
| 83 | 
            -
              end
         | 
| 84 82 | 
             
            end
         |