effective_datatables 4.4.4 → 4.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -4
- data/app/models/effective/effective_datatable/resource.rb +1 -1
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 158ddf59a09940c2dee6187aa2e206104f8552e8
|
4
|
+
data.tar.gz: ea19c893a0e184003d5f60007a171efd07417003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86fe5b9307c518671509dce63bdc6e4b9e99c9a6af22fb992aca3eeee61fba645f3028f1d89702ae0578ae0961dab091b15758e8f81c61c29a9b611ba4b2f86f
|
7
|
+
data.tar.gz: c775b5445a7a328e04b48c24ca6bf9fc2da86c6fdc7cf0860d6dd69d75379e200f5d104085a7a6c9256ba96041e9c322971e1669db61315c86691efd9c9db94e
|
data/README.md
CHANGED
@@ -15,6 +15,12 @@ This gem includes the jQuery DataTables assets.
|
|
15
15
|
|
16
16
|
Works with postgres, mysql, sqlite3 and arrays.
|
17
17
|
|
18
|
+
## Live Demo
|
19
|
+
|
20
|
+
Click here for a [Live Demo](https://effective-datatables-demo.herokuapp.com/).
|
21
|
+
|
22
|
+
See [effective_datatables_demo](https://github.com/code-and-effect/effective_datatables_demo) for a working rails website example.
|
23
|
+
|
18
24
|
## effective_datatables 4.0
|
19
25
|
|
20
26
|
This is the 4.0 series of effective_datatables.
|
@@ -744,7 +750,7 @@ parse: -> { |term| term.to_i } # Parse the incoming term (string) into whatever
|
|
744
750
|
required: true|false # Passed to form
|
745
751
|
```
|
746
752
|
|
747
|
-
Any other option given will be yielded to
|
753
|
+
Any other option given will be yielded to EffectiveBootstrap as options.
|
748
754
|
|
749
755
|
## bulk_actions
|
750
756
|
|
@@ -999,9 +1005,11 @@ datatable do
|
|
999
1005
|
duration = (hours.to_i * 60) + minutes.to_i
|
1000
1006
|
|
1001
1007
|
collection.select! { |row| row[index] == duration } # Must return an Array of Arrays
|
1002
|
-
end.sort do |collection,
|
1003
|
-
|
1004
|
-
|
1008
|
+
end.sort do |collection, direction, column, index|
|
1009
|
+
if direction == :asc
|
1010
|
+
collection.sort! { |a, b| a[index] <=> b[index] }
|
1011
|
+
else
|
1012
|
+
collection.sort! { |a, b| b[index] <=> a[index] }
|
1005
1013
|
end
|
1006
1014
|
end
|
1007
1015
|
end
|
@@ -89,7 +89,7 @@ module Effective
|
|
89
89
|
if opts[:as].kind_of?(Class) && opts[:as].ancestors.include?(ActiveRecord::Base)
|
90
90
|
opts[:resource] = Effective::Resource.new(opts[:as], namespace: controller_namespace)
|
91
91
|
opts[:as] = :resource
|
92
|
-
elsif opts[:as] == nil
|
92
|
+
elsif opts[:as] == nil && row.present?
|
93
93
|
if (value = Array(row[opts[:index]]).first).kind_of?(ActiveRecord::Base)
|
94
94
|
opts[:resource] = Effective::Resource.new(value, namespace: controller_namespace)
|
95
95
|
opts[:as] = :resource
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_datatables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.
|
4
|
+
version: 4.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|