effective_datatables 4.10.1 → 4.10.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b43481421038a1511a8c6ccca052678aa5f70d8c70465e1e267d43fe4f05aa0f
|
4
|
+
data.tar.gz: d598bcb2c9633ab6dabaf7d2fe1cc7078dae9065613022437b200e43d06b1d1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5447d312f17607bb74eb955083085df297beeee2b92bb60ded0271f025a7095b5bae36a473ab79b456efc54cff8787bda574ca1b0c35276228155941023d7fe0
|
7
|
+
data.tar.gz: bd9c7bd9543d56529dc444b1f753087195a8ee6bc7631e07490a6b2d6115624b3c5f8fc2b7fe3dd832e627a7dd9e454be3a9471a0ebaf2cdd289f79abd149521
|
data/README.md
CHANGED
@@ -605,6 +605,12 @@ Any `data-remote` actions will be hijacked and performed as inline ajax by datat
|
|
605
605
|
|
606
606
|
If you'd like to opt-out of this behavior, use `actions_col(inline: false)` or add `data-inline: false` to your action link.
|
607
607
|
|
608
|
+
If the automatic actions_col aren't being displayed, try setting the namespace directly when calling the table
|
609
|
+
|
610
|
+
```
|
611
|
+
MyApp::UsersTable.new(namespace: :my_app)
|
612
|
+
```
|
613
|
+
|
608
614
|
## length
|
609
615
|
|
610
616
|
Sets the default number of rows per page. Valid lengths are `5`, `10`, `25`, `50`, `100`, `250`, `500`, `:all`
|
@@ -17,6 +17,24 @@ module Effective
|
|
17
17
|
@attributes[:namespace] ||= view.controller_path.split('/')[0...-1].join('/')
|
18
18
|
end
|
19
19
|
|
20
|
+
# Polymorphic shorthand attributes.
|
21
|
+
# If you pass resource: User(1), it sets resource_id: 1, resource_type: 'User'
|
22
|
+
def initial_attributes(attributes)
|
23
|
+
return {} if attributes.blank?
|
24
|
+
|
25
|
+
resources = attributes.select { |k, v| v.kind_of?(ActiveRecord::Base) }
|
26
|
+
return attributes if resources.blank?
|
27
|
+
|
28
|
+
retval = attributes.except(*resources.keys)
|
29
|
+
|
30
|
+
resources.each do |k, resource|
|
31
|
+
retval["#{k}_id".to_sym] = resource.id
|
32
|
+
retval["#{k}_type".to_sym] = resource.class.name
|
33
|
+
end
|
34
|
+
|
35
|
+
retval
|
36
|
+
end
|
37
|
+
|
20
38
|
end
|
21
39
|
end
|
22
40
|
end
|
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.10.
|
4
|
+
version: 4.10.2
|
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: 2021-12-
|
11
|
+
date: 2021-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|