effective_datatables 4.10.5 → 4.11.0
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/app/helpers/effective_datatables_private_helper.rb +1 -1
- data/app/models/effective/datatable_column_tool.rb +1 -1
- data/app/models/effective/effective_datatable/dsl/datatable.rb +1 -2
- data/app/models/effective/effective_datatable/format.rb +1 -1
- data/lib/effective_datatables/engine.rb +6 -4
- data/lib/effective_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: 92dfaf548b47e5323f1e08f3ce7167a871c90e7d35deaa403491fba74bf827f2
|
4
|
+
data.tar.gz: 611e25b2241638476ef4f3d77a18921ef07e95c7a5fe262839292e789310039a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f86dd771a3e626feb40ab1766d13939ccb1dc2061b89f21ba87bd174e0ae5a5e31183d13591844434cf759e53378794e9414f2cdee6173e6357b95bb8ef6338b
|
7
|
+
data.tar.gz: a2978ce18ce4f9ef15bbf760591dc13dd2bf7db1acbc8a6d3a77b236b690efec4c7d0d741a73c833a90ea1655b8c8ba8e46e878ee7d93ef904e8f4debb7b665e
|
@@ -30,7 +30,7 @@ module EffectiveDatatablesPrivateHelper
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def datatable_new_resource_button(datatable, name, column)
|
33
|
-
return unless
|
33
|
+
return unless datatable.inline? && (column[:actions][:new] != false)
|
34
34
|
|
35
35
|
action = { action: :new, class: ['btn', column[:btn_class].presence].compact.join(' '), 'data-remote': true }
|
36
36
|
|
@@ -45,7 +45,7 @@ module Effective
|
|
45
45
|
Rails.logger.info "COLUMN TOOL: order_column #{column.to_s} #{direction} #{sql_column}" if EffectiveDatatables.debug
|
46
46
|
|
47
47
|
if column[:sql_as_column]
|
48
|
-
collection.order("#{sql_column} #{datatable.effective_resource.sql_direction(direction)}")
|
48
|
+
collection.order(Arel.sql("#{sql_column} #{datatable.effective_resource.sql_direction(direction)}"))
|
49
49
|
else
|
50
50
|
Effective::Resource.new(collection)
|
51
51
|
.order(column[:name], direction, as: column[:as], sort: column[:sort], sql_column: column[:sql_column], limit: datatable.limit)
|
@@ -90,7 +90,7 @@ module Effective
|
|
90
90
|
)
|
91
91
|
end
|
92
92
|
|
93
|
-
def actions_col(btn_class: nil, col_class: nil,
|
93
|
+
def actions_col(btn_class: nil, col_class: nil, partial: nil, partial_as: nil, actions_partial: nil, responsive: 5000, visible: true, **actions, &format)
|
94
94
|
raise 'You can only have one actions column' if datatable.columns[:_actions].present?
|
95
95
|
|
96
96
|
datatable._columns[:_actions] = Effective::DatatableColumn.new(
|
@@ -102,7 +102,6 @@ module Effective
|
|
102
102
|
csv: false,
|
103
103
|
format: (format if block_given?),
|
104
104
|
index: nil,
|
105
|
-
inline: (inline.nil? ? datatable.inline? : inline),
|
106
105
|
label: false,
|
107
106
|
name: :actions,
|
108
107
|
partial: partial,
|
@@ -155,7 +155,7 @@ module Effective
|
|
155
155
|
def actions_col_actions(column)
|
156
156
|
resource_actions = (effective_resource&.resource_actions || fallback_effective_resource.fallback_resource_actions)
|
157
157
|
|
158
|
-
actions = if
|
158
|
+
actions = if inline?
|
159
159
|
resource_actions.transform_values { |opts| opts['data-remote'] = true; opts }
|
160
160
|
else
|
161
161
|
resource_actions.transform_values { |opts| opts['data-remote'] = true if opts['data-method']; opts }
|
@@ -6,11 +6,13 @@ module EffectiveDatatables
|
|
6
6
|
|
7
7
|
# Include Helpers to base application
|
8
8
|
initializer 'effective_datatables.action_controller' do |app|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
app.config.to_prepare do
|
10
|
+
ActiveSupport.on_load :action_controller_base do
|
11
|
+
helper EffectiveDatatablesHelper
|
12
|
+
helper EffectiveDatatablesPrivateHelper
|
12
13
|
|
13
|
-
|
14
|
+
ActionController::Base.send :include, ::EffectiveDatatablesControllerHelper
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
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
|
+
version: 4.11.0
|
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: 2022-
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|