seek_party 0.0.7 → 0.0.8
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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/seek_party/seek_party_engine.rb +16 -2
- data/lib/seek_party/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ca3c040d22ecaf44d42c4d94f63bc34795a691ebc3fcf24a201ba346611c560
|
4
|
+
data.tar.gz: 884466fbeb0b97fc741e82e21eca594d1611c78407eabb7f44f2606a3f5e8812
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65fba3d3ab15003a1a3c781f8101a405f308688c6fcf3cd0ef1349551c13a795146c67d5e5ccd054af6f1fc26f45321d9574dc5ef0eb22bac38481d61daad8f7
|
7
|
+
data.tar.gz: 2de6b896f03f992aafa9b6cdaf80165289eeaab1eaae0a79c7b736cd436accee7bd1fdcf31018476270c8348e29e92d51f476a3528f948c60fd1920d648e748a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -136,7 +136,7 @@ User.search(params: params)
|
|
136
136
|
And this would result in the following query being produced:
|
137
137
|
|
138
138
|
``` sql
|
139
|
-
SELECT "users".* FROM "users" WHERE (LOWER(CAST(users.name AS TEXT)) LIKE '%
|
139
|
+
SELECT "users".* FROM "users" WHERE (LOWER(CAST(users.name AS TEXT)) LIKE '%bilbo@theshire.com%' AND LOWER(CAST(users.name AS TEXT)) = 'bilbo' OR LOWER(CAST(users.email AS TEXT)) LIKE '%bilbo@theshire.com%' AND LOWER(CAST(users.name AS TEXT)) = 'bilbo')
|
140
140
|
```
|
141
141
|
|
142
142
|
### TO DO
|
@@ -39,8 +39,22 @@ module SeekParty
|
|
39
39
|
# else, as the returned object from run_search is an
|
40
40
|
# ActiveRecord_Relation object that would accept
|
41
41
|
# method chaining
|
42
|
-
@scopes.each do |
|
43
|
-
|
42
|
+
@scopes.each do |scope|
|
43
|
+
if scope.respond_to?(:keys)
|
44
|
+
scope.keys.each do |key|
|
45
|
+
scope_call(key, scope[key])
|
46
|
+
end
|
47
|
+
else
|
48
|
+
scope_call(scope, nil)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def scope_call(key, value)
|
54
|
+
if value.present?
|
55
|
+
@inspected_class = @inspected_class.method(key).call(*value)
|
56
|
+
else
|
57
|
+
@inspected_class = @inspected_class.method(key).call
|
44
58
|
end
|
45
59
|
end
|
46
60
|
end
|
data/lib/seek_party/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seek_party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Washington
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|