effective_datatables 4.8.8 → 4.8.9
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: da2dfe401e2839d034033b2af1b0048cf3c6a726b87a1f6ccc4354eb71183f55
|
4
|
+
data.tar.gz: b6c6a44db10ce020e32bd79de4f1dc8a77106122f7725524414e0ccfa2ee4265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75201440e6f62b181ebce2f54dbaedcffae413a42803e1b0e39a7869f8425e776d51b10b88c2625d142a89895eb6f4ab3f174715782bdb068c5958908b0e36a3
|
7
|
+
data.tar.gz: b9442dab7b1f1b7a1b34e39ec1b67e3241757b1978272ea051c01cf77a9ae074b1ccac33aa18cc52a84a1f735697b41c72fba970a1d39a0c1a734d40c17f125c
|
@@ -44,7 +44,7 @@ module EffectiveDatatablesPrivateHelper
|
|
44
44
|
action = { action: :new, class: ['btn', column[:btn_class].presence].compact.join(' '), 'data-remote': true }
|
45
45
|
|
46
46
|
if column[:actions][:new].kind_of?(Hash) # This might be active_record_array_collection?
|
47
|
-
action
|
47
|
+
action.merge!(column[:actions][:new])
|
48
48
|
|
49
49
|
effective_resource = (datatable.effective_resource || datatable.fallback_effective_resource)
|
50
50
|
klass = (column[:actions][:new][:klass] || effective_resource&.klass || datatable.collection_class)
|
@@ -84,7 +84,7 @@ module EffectiveDatatablesPrivateHelper
|
|
84
84
|
collection = opts[:search].delete(:collection)
|
85
85
|
value = datatable.state[:search][name]
|
86
86
|
|
87
|
-
options = opts[:search].
|
87
|
+
options = opts[:search].merge!(
|
88
88
|
name: nil,
|
89
89
|
feedback: false,
|
90
90
|
label: false,
|
@@ -92,24 +92,26 @@ module EffectiveDatatablesPrivateHelper
|
|
92
92
|
data: { 'column-name': name, 'column-index': opts[:index] }
|
93
93
|
)
|
94
94
|
|
95
|
+
options.delete(:fuzzy)
|
96
|
+
|
95
97
|
case options.delete(:as)
|
96
98
|
when :string, :text, :number
|
97
99
|
form.text_field name, options
|
98
100
|
when :date, :datetime
|
99
|
-
form.date_field name, options.reverse_merge(
|
101
|
+
form.date_field name, options.reverse_merge!(
|
100
102
|
date_linked: false, prepend: false, input_js: { useStrict: true, keepInvalid: true }
|
101
103
|
)
|
102
104
|
when :time
|
103
|
-
form.time_field name, options.reverse_merge(
|
105
|
+
form.time_field name, options.reverse_merge!(
|
104
106
|
date_linked: false, prepend: false, input_js: { useStrict: false, keepInvalid: true }
|
105
107
|
)
|
106
108
|
when :select, :boolean
|
107
|
-
options[:input_js] = (options[:input_js] || {}).reverse_merge(placeholder: '')
|
109
|
+
options[:input_js] = (options[:input_js] || {}).reverse_merge!(placeholder: '')
|
108
110
|
|
109
111
|
form.select name, collection, options
|
110
112
|
when :bulk_actions
|
111
113
|
options[:data]['role'] = 'bulk-actions'
|
112
|
-
form.check_box name, options.merge(label: ' ')
|
114
|
+
form.check_box name, options.merge!(label: ' ')
|
113
115
|
end
|
114
116
|
end
|
115
117
|
|
@@ -139,7 +141,7 @@ module EffectiveDatatablesPrivateHelper
|
|
139
141
|
placeholder: (opts[:label] || name.to_s.titleize),
|
140
142
|
value: value,
|
141
143
|
wrapper: { class: 'form-group col-auto'}
|
142
|
-
}.merge(opts.except(:as, :collection, :parse, :value))
|
144
|
+
}.merge!(opts.except(:as, :collection, :parse, :value))
|
143
145
|
|
144
146
|
options[:name] = '' unless datatable._filters_form_required?
|
145
147
|
|
@@ -171,7 +173,7 @@ module EffectiveDatatablesPrivateHelper
|
|
171
173
|
label: false,
|
172
174
|
required: false,
|
173
175
|
wrapper: { class: 'form-group col-auto'}
|
174
|
-
}.merge(opts.except(:checked, :value))
|
176
|
+
}.merge!(opts.except(:checked, :value))
|
175
177
|
|
176
178
|
form.radios :scope, collection, options
|
177
179
|
end
|
@@ -98,9 +98,11 @@ module Effective
|
|
98
98
|
opts[:sql_as_column] = true if (effective_resource.table && effective_resource.column(name).blank?)
|
99
99
|
end
|
100
100
|
|
101
|
-
if opts[:sql_column].present?
|
102
|
-
opts[:
|
101
|
+
if opts[:sql_column].present?
|
102
|
+
sql_column = opts[:sql_column].to_s
|
103
|
+
opts[:sql_as_column] = true if AGGREGATE_SQL_FUNCTIONS.any? { |str| sql_column.start_with?(str) }
|
103
104
|
end
|
105
|
+
|
104
106
|
end
|
105
107
|
end
|
106
108
|
|
@@ -200,7 +202,7 @@ module Effective
|
|
200
202
|
|
201
203
|
def load_resource_belongs_tos!
|
202
204
|
return unless active_record_collection?
|
203
|
-
return unless @_collection_apply_belongs_to
|
205
|
+
return unless @_collection_apply_belongs_to
|
204
206
|
|
205
207
|
changed = attributes.select do |attribute, value|
|
206
208
|
attribute = attribute.to_s
|