hario 0.3.2 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 97de0f6a71c9f49cdaf1345f355a98abba9bb8cd
4
- data.tar.gz: 7419b8900b7563e7d85abb097e2727f08b6ff3e0
2
+ SHA256:
3
+ metadata.gz: 0c8b8bf6f818c006ad4697f801728b977f01009ff3014e3ae516aabdf978ff14
4
+ data.tar.gz: 04abafdddc6d26b9ac1eb3d8d0e3160da7adbc51c9e03278887277ac38b303d2
5
5
  SHA512:
6
- metadata.gz: 02ca54882c78d0b49bef4eef26277081a245e91e5f853a54d419ac670cc5d71bf0643c2261f22b6efecde733e29c7cf0418332d3c32998057e327d4a1a17bb03
7
- data.tar.gz: 00d224e9211e803d087f2c6f4434a858bf055705681f6a4e02dcdfd1721f74ba4121165c0a791e52b5bd776435a746843156a2f0555217f7f2f21abce22c00dc
6
+ metadata.gz: 13da71735f0491db6e3f944757c29ec0a47f711d12578cd222957cf94aeb93d366f3079a7359993b24ae38d6075a8fa012c2bc8adeede4bb39a8e079892c7f19
7
+ data.tar.gz: 51be388b7342ec1b0f511b78bfa22ddd461bd266294d7862b27a576b7fec945b7f47cebb39fcd29cdc2133a64f1b7f16415cc8daa4d956e302dc98fb28d9b734
data/README.md CHANGED
@@ -80,6 +80,7 @@ The available operators are:
80
80
  - gte (greater than or equal)
81
81
  - like (sql like)
82
82
  - equals
83
+ - in
83
84
 
84
85
  ### Pluck
85
86
 
@@ -4,7 +4,7 @@ module Hario
4
4
  class FilterParser
5
5
  include ParserUtils
6
6
 
7
- OPERATORS = { lt: '<', gt: '>', lte: '<=', gte: '>=', like: 'like', equals: '=', is: 'is' }
7
+ OPERATORS = { lt: '<', gt: '>', lte: '<=', gte: '>=', like: 'like', equals: '=', is: 'is', in: 'in' }
8
8
  IS_VALUES = { null: 'NULL', not_null: 'NOT NULL' }
9
9
 
10
10
  attr_accessor :join_clause, :where_clauses
@@ -55,6 +55,10 @@ module Hario
55
55
  when :equals
56
56
  condition = { attribute => value }
57
57
  condition = { attribute_table => condition } if attribute_table
58
+ when :in
59
+ value = value.split(',').map(&:strip) if value.is_a?(String)
60
+ condition = { attribute => value }
61
+ condition = { attribute_table => condition } if attribute_table
58
62
  when :is
59
63
  value = value.to_sym
60
64
  raise_if_invalid_is_value!(value)
data/lib/hario/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hario
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hario
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Campbell
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2017-05-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -80,7 +79,6 @@ dependencies:
80
79
  - - ">="
81
80
  - !ruby/object:Gem::Version
82
81
  version: '0'
83
- description:
84
82
  email:
85
83
  - mike@wordofmike.net
86
84
  executables: []
@@ -110,7 +108,6 @@ homepage: https://github.com/meritec/hario
110
108
  licenses:
111
109
  - MIT
112
110
  metadata: {}
113
- post_install_message:
114
111
  rdoc_options: []
115
112
  require_paths:
116
113
  - lib
@@ -125,9 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
122
  - !ruby/object:Gem::Version
126
123
  version: '0'
127
124
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.5.1
130
- signing_key:
125
+ rubygems_version: 3.6.9
131
126
  specification_version: 4
132
127
  summary: Hario provides ActiveRecord filtering for Rails APIs.
133
128
  test_files: