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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff2fc2d1c01b95734ac79fc727db5683a484399a5e68b370c1c80665310b2758
4
- data.tar.gz: 4c1a8848ab3a22590c902388814ce9faec463adfa032e68d0144568282788d54
3
+ metadata.gz: 92dfaf548b47e5323f1e08f3ce7167a871c90e7d35deaa403491fba74bf827f2
4
+ data.tar.gz: 611e25b2241638476ef4f3d77a18921ef07e95c7a5fe262839292e789310039a
5
5
  SHA512:
6
- metadata.gz: 9001e7fe0a63a75445f35a9a36046a40a067f31c57e424ac0ac5c76a83662b762238e9a3e15b45b6ac893af369a97d2f3b3becaac01ff8b93fb3ccdeff94c29c
7
- data.tar.gz: 8a4be22def5f90615598d06a0a89b578bb088be5b61beb2b65267466070b80fe3490e40821755158857357abf4faff15a45ea4957bda17ba5316489b10397eb1
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 column[:inline] && (column[:actions][:new] != false)
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, inline: nil, partial: nil, partial_as: nil, actions_partial: nil, responsive: 5000, visible: true, **actions, &format)
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 column[:inline]
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
- ActiveSupport.on_load :action_controller_base do
10
- helper EffectiveDatatablesHelper
11
- helper EffectiveDatatablesPrivateHelper
9
+ app.config.to_prepare do
10
+ ActiveSupport.on_load :action_controller_base do
11
+ helper EffectiveDatatablesHelper
12
+ helper EffectiveDatatablesPrivateHelper
12
13
 
13
- ActionController::Base.send :include, ::EffectiveDatatablesControllerHelper
14
+ ActionController::Base.send :include, ::EffectiveDatatablesControllerHelper
15
+ end
14
16
  end
15
17
  end
16
18
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.10.5'.freeze
2
+ VERSION = '4.11.0'.freeze
3
3
  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.5
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-02-24 00:00:00.000000000 Z
11
+ date: 2022-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails