effective_datatables 1.4.2 → 1.4.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: 602fa7eaf9f2651d3eb006eb0429f0b556f2299e
4
- data.tar.gz: 7be8486ef756e02a8593a2cae680ba5a3679b1dd
3
+ metadata.gz: d9060f91d84bd318fe28e34f45e090d549de9223
4
+ data.tar.gz: ddeb0892a9608be234b1ce6782bd1cc4d855f8e3
5
5
  SHA512:
6
- metadata.gz: 0a6c4c9d225ce923e048b2d85207c4094dc1c69dc5bcd46a7a919b8492b498565d93b22339ab24688b94f0978f37590b0cc3c2f43f455e2201a8be1231ec935e
7
- data.tar.gz: dd67c7efed037d645eebbd3766249c4e9eed0313de0923737f0aef6c19d589f0756caa396894fc38892bc44d9551e282a160d0ceda2f7a7d7e69546ea7302950
6
+ metadata.gz: c510040563247f7d309fa7692b1e41e0ff5b96fa2a1499aacbfea45086860e0d653213f5cc2412b60365a02b7b4f203bd6b2542f75d151c8750fa9ae877d2a98
7
+ data.tar.gz: e685ae5e4807066534798f4e1b846f48742e71a716ed3a2b63ff12b810b2b6f8cab07a2d0a6e8bd17a2b1a0f9c0fbfaa8be95a61357c2a91950249dfd8167435
data/README.md CHANGED
@@ -568,12 +568,13 @@ module Effective
568
568
 
569
569
  def collection
570
570
  [
571
- [1, 'Matthew', 'Riemer', 'matthew@agilestyle.com'],
572
- [2, 'Dallas', 'Meidinger', 'dallas@agilestyle.com'],
573
- [3, 'Warren', 'Uhrich', 'warren@agilestyle.com'],
571
+ [1, 'Dana', 'Janssen', 'dana@agilestyle.com'],
572
+ [2, 'Ashley', 'Janssen', 'ashley@agilestyle.com'],
573
+ [3, 'Matthew', 'Riemer', 'matthew@agilestyle.com'],
574
574
  [4, 'Stephen', 'Brown', 'stephen@agilestyle.com'],
575
- [5, 'Dana', 'Janssen', 'dana@agilestyle.com'],
576
- [6, 'Ashley', 'Janssen', 'ashley@agilestyle.com'],
575
+ [5, 'Warren', 'Uhrich', 'warren@agilestyle.com'],
576
+ [6, 'Dallas', 'Meidinger', 'dallas@agilestyle.com'],
577
+ [7, 'Nathan', 'Feaver', 'nathan@agilestyle.com']
577
578
  ]
578
579
  end
579
580
 
@@ -18,10 +18,12 @@ module Effective
18
18
  end
19
19
 
20
20
  def order(collection)
21
- if order_column.present?
22
- collection.order("#{order_column[:column]} #{order_direction} NULLS #{order_direction == 'ASC' ? 'LAST' : 'FIRST'}")
21
+ return collection if order_column.blank?
22
+
23
+ if [:string, :text].include?(order_column[:type])
24
+ collection.order("COALESCE(#{order_column[:column]}, '') #{order_direction}")
23
25
  else
24
- collection
26
+ collection.order("#{order_column[:column]} #{order_direction} NULLS #{order_direction == 'ASC' ? 'LAST' : 'FIRST'}")
25
27
  end
26
28
  end
27
29
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '1.4.2'.freeze
2
+ VERSION = '1.4.3'.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: 1.4.2
4
+ version: 1.4.3
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: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails