table_on_steroids 0.1.1.6 → 0.1.1.7
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/.circleci/config.yml +25 -0
- data/Gemfile.lock +4 -4
- data/app/controllers/concerns/table_on_steroids/table_concern.rb +9 -3
- data/lib/table_on_steroids/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cab4f42deed0c3f15ab7b961d1894ebd095e4027db8538818d1536e1028cedb5
|
4
|
+
data.tar.gz: d0034c6bbd8c45d0134afadd91f61bfc717b8be30176049e7241ddf5cd40dec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f2d88f83663a65b6d0d87e2f56ef251b72bacaf949698d23cb97d74609aa59ef1ca5a04b89bb70326241c463ee3527b008f903ebb7a3865c9e9436d97926a2
|
7
|
+
data.tar.gz: 84c1d3b4cc10b9b8afd456777a840274e0fe6b6628797b21d64a61eb24a32da29d2f1e8a6b6307c2fd5ecd739407cf4621a4e54624c9dd3f9fa6c562360e7e66
|
@@ -0,0 +1,25 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
docker:
|
5
|
+
- image: circleci/ruby:2.4.1
|
6
|
+
steps:
|
7
|
+
- checkout
|
8
|
+
|
9
|
+
- restore_cache:
|
10
|
+
keys:
|
11
|
+
- table-on-steroids-bundle-{{checksum "Gemfile.lock"}}
|
12
|
+
- table-on-steroids-bundle-
|
13
|
+
|
14
|
+
- run:
|
15
|
+
name: bundle install
|
16
|
+
command: bundle check --path vendor/bundle || bundle install --deployment
|
17
|
+
|
18
|
+
- save_cache:
|
19
|
+
key: table-on-steroids-bundle-{{checksum "Gemfile.lock"}}
|
20
|
+
paths:
|
21
|
+
- vendor/bundle
|
22
|
+
|
23
|
+
- run:
|
24
|
+
name: Run spec
|
25
|
+
command: bundle exec rspec
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
table_on_steroids (0.1.1.
|
4
|
+
table_on_steroids (0.1.1.6)
|
5
5
|
bootstrap-datepicker-rails (~> 1)
|
6
6
|
bootstrap-select-rails (~> 1.3)
|
7
7
|
kaminari (~> 1.1)
|
@@ -62,7 +62,7 @@ GEM
|
|
62
62
|
method_source (0.9.2)
|
63
63
|
mini_portile2 (2.4.0)
|
64
64
|
minitest (5.11.3)
|
65
|
-
nokogiri (1.10.
|
65
|
+
nokogiri (1.10.4)
|
66
66
|
mini_portile2 (~> 2.4.0)
|
67
67
|
rack (2.0.7)
|
68
68
|
rack-test (1.1.0)
|
@@ -70,7 +70,7 @@ GEM
|
|
70
70
|
rails-dom-testing (2.0.3)
|
71
71
|
activesupport (>= 4.2.0)
|
72
72
|
nokogiri (>= 1.6)
|
73
|
-
rails-html-sanitizer (1.0
|
73
|
+
rails-html-sanitizer (1.2.0)
|
74
74
|
loofah (~> 2.2, >= 2.2.2)
|
75
75
|
railties (5.2.3)
|
76
76
|
actionpack (= 5.2.3)
|
@@ -107,4 +107,4 @@ DEPENDENCIES
|
|
107
107
|
table_on_steroids!
|
108
108
|
|
109
109
|
BUNDLED WITH
|
110
|
-
1.
|
110
|
+
1.17.3
|
@@ -105,7 +105,9 @@ module TableOnSteroids
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def all_column_search(objects, columns_on_steroid, query, table_on_steroids=nil)
|
108
|
-
|
108
|
+
global_active_record_search_key = table_on_steroids&.dig(:global_active_record_search_key) || :id
|
109
|
+
global_array_search_key_index = table_on_steroids&.dig(:global_array_search_key_index) || 0
|
110
|
+
global_search_key = ((objects && objects[0].is_a?(Array)) ? global_array_search_key_index : global_active_record_search_key)
|
109
111
|
global_search_key_params = {}
|
110
112
|
matched_object_keys = []
|
111
113
|
|
@@ -122,8 +124,12 @@ module TableOnSteroids
|
|
122
124
|
end
|
123
125
|
end
|
124
126
|
|
125
|
-
|
126
|
-
|
127
|
+
if(objects.is_a?(ActiveRecord::Base) || objects.is_a?(ActiveRecord::Relation))
|
128
|
+
global_search_key_params[global_active_record_search_key] = matched_object_keys.uniq
|
129
|
+
objects = objects.where(global_search_key_params)
|
130
|
+
elsif(objects.is_a?(Array))
|
131
|
+
objects = objects.select{|o| o if(matched_object_keys.uniq.include?(o[global_search_key]))}
|
132
|
+
end
|
127
133
|
end
|
128
134
|
|
129
135
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_on_steroids
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marieke Gueye
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bootstrap-datepicker-rails
|
@@ -102,6 +102,7 @@ executables: []
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
+
- ".circleci/config.yml"
|
105
106
|
- ".gitignore"
|
106
107
|
- ".rspec"
|
107
108
|
- ".travis.yml"
|