hario 0.3.1 → 0.4.0

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: 136e0b28f2d3f6bc51ba637b83c31f48fcdda3ca
4
- data.tar.gz: a8b61b6290486260fe75361a503513b98ca689d6
2
+ SHA256:
3
+ metadata.gz: 848a772343845f190829132514fd9b48ebbeed888942101b5a506c56471cefa6
4
+ data.tar.gz: 686ea3e558172f4323c34d8a582cb894dc2c651fb1bbef8968652ccac14c5764
5
5
  SHA512:
6
- metadata.gz: 2f96e37359a8f64548d93c65c2ca1421cfa99551f236dc5ae465da78bd978e1704ce81a87bf07271e9bdc5cb0ace2d854d3c99f39046bf0a75c554ff14413f6b
7
- data.tar.gz: eb7059a076117f97f07e20681af33d67c43d12d028fe28781bb99b9b9aff371a79ebaac29ffec4195e4ce584da75680142f87a842e61203c75f5a67651a3b3ac
6
+ metadata.gz: 55fd4028f152d38dd651166c0594cc1d4bdd587df3efbd54d323689c2e4f0acffcf30f4f201da91a198a9e28dcd8bb80b43c221656286cbaaf341a21feec4e8c
7
+ data.tar.gz: a6216c57c9749b1770463c48f74222a85b808e8c6abdf005cdccb971134046faac35f12af3ff40acf9f6f9381e8234e5428caa2930264efbbeeaee5da55f5b26
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
@@ -52,7 +52,7 @@ module Hario
52
52
  raise_if_invalid_attribute!(attribute, end_model)
53
53
 
54
54
  case operator
55
- when :equals
55
+ when :equals, :in
56
56
  condition = { attribute => value }
57
57
  condition = { attribute_table => condition } if attribute_table
58
58
  when :is
data/lib/hario/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hario
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/hario.rb CHANGED
@@ -9,6 +9,7 @@ module Hario
9
9
  attr_reader :hario_attributes_list
10
10
 
11
11
  def search(filters, pluck = [])
12
+ pluck ||= []
12
13
  pluck = pluck.reject{ |p| p.nil? || p.empty? }
13
14
 
14
15
  s = all
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.1
4
+ version: 0.4.0
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-03 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: