effective_datatables 4.8.3 → 4.8.4
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: 53f857de2d8388bada0837e3eca598ab75e45cba907bde7b43c01a13c2037cb1
|
4
|
+
data.tar.gz: '0488a5bf9fafd8a54833615f6d7610d22567d97c5e1b0d13cd2476e24706d08b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 740d034417e5aa04860b12a308f4e495b3856c4b86a67443f6ec2e18900a55be58c6edb7235d8ef66981bb827f05ecab29d3f691765b5dee43f5312804644adf
|
7
|
+
data.tar.gz: 91712a50aff213013867fd46bbdedc717e0c95fef1748d2d9076bfdd5930ce14a3fff1d158f0feed409c8431fb16b317fae1c34b21accd855546dc089c9dbb0d
|
@@ -4,7 +4,7 @@ module Effective
|
|
4
4
|
AGGREGATE_SQL_FUNCTIONS = ['ARRAY_AGG(', 'AVG(', 'COUNT(', 'MAX(', 'MIN(', 'STRING_AGG(', 'SUM(']
|
5
5
|
|
6
6
|
def admin_namespace?
|
7
|
-
|
7
|
+
[:admin, 'admin'].include?(controller_namespace)
|
8
8
|
end
|
9
9
|
|
10
10
|
def controller_namespace
|
@@ -200,6 +200,7 @@ module Effective
|
|
200
200
|
|
201
201
|
def load_resource_belongs_tos!
|
202
202
|
return unless active_record_collection?
|
203
|
+
return unless @_collection_apply_belongs_to
|
203
204
|
|
204
205
|
changed = attributes.select do |attribute, value|
|
205
206
|
attribute = attribute.to_s
|
@@ -210,7 +211,7 @@ module Effective
|
|
210
211
|
next unless columns[associated]
|
211
212
|
|
212
213
|
if columns[associated][:as] == :belongs_to
|
213
|
-
|
214
|
+
unless @_collection.where_values_hash.include?(attribute)
|
214
215
|
@_collection = @_collection.where(attribute => value)
|
215
216
|
end
|
216
217
|
|
@@ -218,10 +219,8 @@ module Effective
|
|
218
219
|
elsif columns[associated][:as] == :belongs_to_polymorphic
|
219
220
|
associated_type = attributes["#{associated}_type".to_sym] || raise("Expected #{associated}_type attribute to be present when #{associated}_id is present on a polymorphic belongs to")
|
220
221
|
|
221
|
-
|
222
|
-
|
223
|
-
@_collection = @_collection.where(attribute => value).where("#{associated}_type" => associated_type)
|
224
|
-
end
|
222
|
+
unless @_collection.where_values_hash.include?(attribute) || @_collection.where_values_hash.include?("#{associated}_type")
|
223
|
+
@_collection = @_collection.where(attribute => value).where("#{associated}_type" => associated_type)
|
225
224
|
end
|
226
225
|
|
227
226
|
columns.delete(associated)
|
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.8.
|
4
|
+
version: 4.8.4
|
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: 2020-07-
|
11
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|