effective_datatables 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: c823dd7f44e5191f730076d3fec30747fa5332b8
4
- data.tar.gz: 30ac156546c0fcd154abc0e3e144fe5a8ea7ab75
3
+ metadata.gz: ab3303e9840fd59709b75a87ee4b6165f44dbb2e
4
+ data.tar.gz: 64908b59ab4c276098b53b98e273b246dc5262ac
5
5
  SHA512:
6
- metadata.gz: acb37922961188b750bf9b69f77fde79b06571b67274dcb76a6918d0a927020cc897a2e353898dfd12199c6f09b911bd79027add70f2e42c7971e1037a44e698
7
- data.tar.gz: 8a2f0c023604461e9a03ea95f65bc6016efa786e012c58767085fa732152bcd0be4aa16d750eb2c954d552502c9b032113bb45b3ceda5dce36b0750068d32540
6
+ metadata.gz: e20d80db67245944e54982a9bd7e172aa1fbd26536ee65feb06aeda3f770a7c4b0ae6a56b0585fafeb3a4ce2989d8a4525832c4a8e1f3839496b667c70b3e3ae
7
+ data.tar.gz: 856f9f5e260bb67e6d73247121f54128ff36051756d4247c8bcb7a9688f331114accc7009b41b5348f21be2ea61263e06a070dd3814e66a2fe9a5060de2f5dbb
@@ -314,16 +314,12 @@ module Effective
314
314
  cols[name][:column] ||= (sql_table && sql_column) ? "\"#{sql_table.name}\".\"#{sql_column.name}\"" : name
315
315
  cols[name][:width] ||= nil
316
316
  cols[name][:sortable] = true if cols[name][:sortable] == nil
317
+ cols[name][:type] ||= (belong_tos.key?(name) ? :belongs_to : (sql_column.try(:type).presence || :string))
317
318
 
318
- cols[name][:type] ||= (
319
- if belong_tos.key?(name)
320
- :belongs_to
321
- elsif name == 'id' && collection.respond_to?(:deobfuscate)
322
- :obfuscated_id
323
- else
324
- sql_column.try(:type).presence || :string
325
- end
326
- )
319
+ if name == 'id' && collection.respond_to?(:deobfuscate)
320
+ cols[name][:sortable] = false
321
+ cols[name][:type] = :obfuscated_id
322
+ end
327
323
 
328
324
  cols[name][:filter] = initialize_table_column_filter(cols[name][:filter], cols[name][:type], belong_tos[name])
329
325
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '1.0.2'.freeze
2
+ VERSION = '1.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect