like_query 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb533ef11731913bdf3356f5177354cbdc85b4506ba2aae392f7149b7fe7e6d2
4
- data.tar.gz: 4b256fb9aa9336559e6a9fc529e7376fae1f6fc09da1cd9b662eb18dd770c5dd
3
+ metadata.gz: '049ab00db40571bcb74c02122aa68da955b145bd808330336ca5405e9b394c28'
4
+ data.tar.gz: 772e0bc35a1fbb766d2ea2e10fa018bfb9445e2aac5b9fff81aed107b9a43887
5
5
  SHA512:
6
- metadata.gz: 6fdeaadc79ef10c0690dff7d0213d8241ea0f01679fdb1494d95bb4b9f975813ef5319ae2639a431bb291793ca74ceb1902ca11e9ba5ad9b7423f114c4b3ed0e
7
- data.tar.gz: 7d53223f4fe56b448e28aebb46e3db3f400de45b7698a5a3526543612180f4a937951733ade9cff093e177e9d4340fd50b90cc132ea64be811cde32ab2440e7b
6
+ metadata.gz: 55ad5c0c0bfb442f48b5a9a05fad45ad3fb066c573799dd498ff55f2fb68b1651cf290bde35861d09f4f70fc6cd7cadf65e2b3cdec63bd41ff26bf2876543b07
7
+ data.tar.gz: ed8a996db26473442d8ad3e117d387f4c18bef2f13b9d88749ce5ee1ff5ad0f44df0d3506fbc3880ae30b26e7b3c2584f6d96aee9978421ec735a94461ad5f3c
@@ -58,7 +58,7 @@ module LikeQuery
58
58
 
59
59
  _cols = if cols.is_a?(Hash)
60
60
  image_column = cols[:image]
61
- cols[:attributes]
61
+ cols[:values]
62
62
  elsif cols.is_a?(Enumerable)
63
63
  cols
64
64
  else
@@ -68,7 +68,7 @@ module LikeQuery
68
68
  (sub_records.is_a?(Enumerable) ? sub_records : [sub_records]).each do |sub_record|
69
69
  sub_attr = []
70
70
  _cols.each do |c|
71
- sub_attr.push([c, sub_record.send(c)])
71
+ sub_attr.push(sub_record.send(c))
72
72
  end
73
73
 
74
74
  if @length >= @limit || (limit && length >= limit)
@@ -79,7 +79,7 @@ module LikeQuery
79
79
  @sub_records_columns_count = c if c > @sub_records_columns_count
80
80
  rec_attr[:associations] ||= {}
81
81
  rec_attr[:associations][assoc] ||= []
82
- sub_hash = { attributes: sub_attr, id: sub_record.id, model: sub_record.class.to_s.underscore }
82
+ sub_hash = { values: sub_attr, id: sub_record.id, model: sub_record.class.to_s.underscore }
83
83
  if image_column
84
84
  sub_hash[:image] = get_column_value(sub_record, image_column)
85
85
  @sub_records_image = true
@@ -95,8 +95,8 @@ module LikeQuery
95
95
 
96
96
  # MAIN RECORD
97
97
 
98
- rec_attr[:attributes] ||= []
99
- rec_attr[:attributes].push([p, get_column_value(r, p)])
98
+ rec_attr[:values] ||= []
99
+ rec_attr[:values].push(get_column_value(r, p))
100
100
  rec_attr[:id] = r.id
101
101
  rec_attr[:model] = r.class.to_s.underscore
102
102
 
@@ -106,7 +106,7 @@ module LikeQuery
106
106
  @overflow = true
107
107
  break
108
108
  else
109
- c = (image ? 1 : 0) + rec_attr[:attributes].length
109
+ c = (image ? 1 : 0) + rec_attr[:values].length
110
110
  @columns_count = c if c > @columns_count
111
111
  @data.push(rec_attr)
112
112
  @length += 1
@@ -1,3 +1,3 @@
1
1
  module LikeQuery
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: like_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian