querier 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/querier.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b665dcde0c37b483e764ddcf1d30221ba9c4b34f478533e6fb911aaf11a81996
4
- data.tar.gz: 4bd3bb6e6e3cc430b257ac9b408629440b8249ad642c1db89a6f9ece21d671f3
3
+ metadata.gz: de1729ce8cc885a52a8a5892e79d2a4e4008b48d95d5a821c2f985bc5925abf9
4
+ data.tar.gz: 0db5814a6b46ecd4d73f766763d1f82347c2fecf3075c0f1c3218d6870b4cfa9
5
5
  SHA512:
6
- metadata.gz: 5e0fc946d4e39bc164ffeda2bd762c4e3bddc4f769363d9590e4dc08a6a7379b3f3e27f5516b93baaea2a8c8216ac2808946096a0f48a28b847246d8a73d1da7
7
- data.tar.gz: 3af81af98208e77a0f9360de68a5d15cd45e153613aaa5e1654157bcf4ea4ccf77977c80d1e30b22259db96eabff5d13bc6b66a843c4cbbcb210ad114ac905c6
6
+ metadata.gz: b3384fe46ceb0cbfbd19e15caa51d4e8bb14e77e2565d4db001f773d6fb2d8ac1a88f53ede1527f150ae3d916a50d41e7ac7aed789ca59f72b58a9f0f1871c8f
7
+ data.tar.gz: 343e400b47d07e0e8e55be4b025fbca6c3e672e01ece56ab3bd6c13061eb9e1597d27dfe70c36ebeb17904efcc2676a4ee7f90ffc921f1f63b9799755f5af88d
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # querier
2
2
 
3
3
  # class UserQuerier < Querier
4
+ @active_record_class = ApplicationRecord
4
5
  def initialize user_name:, active:
5
6
  @query_template = "SELECT * FROM users WHERE name = ${user_name} AND active = ${active}"
6
7
  super
data/lib/querier.rb CHANGED
@@ -50,7 +50,7 @@ class Querier
50
50
  end
51
51
 
52
52
  def field_group_and_count(field_name:, sort_element_index: nil, reverse_sort: true)
53
- count_result = cached_results(format: :open_struct).group_by(&field_name).map { |k, v| [k, v.count] }
53
+ count_result = cached_result(format: :open_struct).group_by(&field_name).map { |k, v| [k, v.count] }
54
54
 
55
55
  unless sort_element_index.nil?
56
56
  count_result = count_result.sort_by { |el| el[sort_element_index] }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: querier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gedean Dias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-05 00:00:00.000000000 Z
11
+ date: 2021-08-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Active Record queries with variable number of params
14
14
  email: gedean.dias@gmail.com
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  requirements: []
40
- rubygems_version: 3.2.15
40
+ rubygems_version: 3.2.25
41
41
  signing_key:
42
42
  specification_version: 4
43
43
  summary: Active Record Querier