trk_datatables 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -1
- data/lib/trk_datatables/column_key_options.rb +11 -9
- data/lib/trk_datatables/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: 8c62f6190d44143f7d76ef88fce49357c06a2e693bc96164cb678f0f5935f817
|
4
|
+
data.tar.gz: 3a5ab2c6e062acd588484e3907e135875ab688c5ff88b4c075f0e42f785a00b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22dc186b88537bab98e1b36981fcce153e325252935e873b8007a176943e7e48caf5c90868e2bdffe6055bdc171a06f9ed9367fe821eb07bbd801b9e0a9e48a2
|
7
|
+
data.tar.gz: c6d7304344a2f174444cc5d6de704d68e4ef6af4ea6a611cd1d5aca7ded896abdd279721245ef9ff2fbe8268af88c02ecdc97a26e79348d96e57e8da2242ed52
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -488,7 +488,11 @@ side rendering and more advance listing
|
|
488
488
|
|
489
489
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
490
490
|
|
491
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To
|
491
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
492
|
+
release a new version, update the version number in
|
493
|
+
`lib/trk_datatables/version.rb`, and then run `bundle exec rake release`, which
|
494
|
+
will create a git tag for the version, push git commits and tags, and push the
|
495
|
+
`.gem` file to [rubygems.org](https://rubygems.org).
|
492
496
|
|
493
497
|
Instead of installing you can point directly to your path
|
494
498
|
```
|
@@ -38,7 +38,7 @@ module TrkDatatables
|
|
38
38
|
STRING_TYPE_CAST_ORACLE = 'VARCHAR2(4000)'.freeze
|
39
39
|
|
40
40
|
DB_ADAPTER_STRING_TYPE_CAST = {
|
41
|
-
|
41
|
+
postgresql: STRING_TYPE_CAST_POSTGRES,
|
42
42
|
mysql: STRING_TYPE_CAST_MYSQL,
|
43
43
|
mysql2: STRING_TYPE_CAST_MYSQL,
|
44
44
|
sqlite: STRING_TYPE_CAST_SQLITE,
|
@@ -64,13 +64,13 @@ module TrkDatatables
|
|
64
64
|
# short notation is when we use array of keys.
|
65
65
|
# In case first element is hash than we will use that hash
|
66
66
|
if cols.is_a? Array
|
67
|
-
if cols.first.is_a? Hash
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
67
|
+
cols = if cols.first.is_a? Hash
|
68
|
+
cols.first
|
69
|
+
else
|
70
|
+
cols.each_with_object({}) do |column_key, hash|
|
71
|
+
hash[column_key.to_sym] = {}
|
72
|
+
end
|
73
|
+
end
|
74
74
|
end
|
75
75
|
_set_data(cols)
|
76
76
|
_set_global_search_cols(global_search_cols)
|
@@ -87,9 +87,11 @@ module TrkDatatables
|
|
87
87
|
|
88
88
|
if table_name.blank?
|
89
89
|
column_name = column_options[TITLE_OPTION] || 'actions' # some default name for a title
|
90
|
+
column_options[SEARCH_OPTION] = false
|
91
|
+
column_options[ORDER_OPTION] = false
|
90
92
|
else
|
91
93
|
table_class = table_name.singularize.camelcase.constantize
|
92
|
-
column_type_in_db = _determine_db_type_for_column(table_class, column_name) unless
|
94
|
+
column_type_in_db = _determine_db_type_for_column(table_class, column_name) unless column_options[SEARCH_OPTION] == false && column_options[ORDER_OPTION] == false
|
93
95
|
end
|
94
96
|
arr << {
|
95
97
|
column_key: column_key.to_sym,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trk_datatables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dusan Orlovic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|