activerecord-sort 6.0.0.1 → 6.0.0.2

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: 0005626b6dcbe3c8ae88ccca950bceca6a784227048862b461655409f1ac764a
4
- data.tar.gz: 4316cc14a6cfe199e25bd868d2ad148072f2bdc28a5b93ac93ef434bf708410c
3
+ metadata.gz: cff1abfec5ff89217d35624be89876e6f88943250f3da263d39caf520fa20b9b
4
+ data.tar.gz: 7ce1af43d5e20dea32de13d1b542b6efa6f43b6a94a18bfabffb319740fedba4
5
5
  SHA512:
6
- metadata.gz: ee4c6655f397bd895b64cdc33fa1202884cfee0e1e1fbc9ddb8720b3a5b235cf2553066576ffbdae39dc05d3d139906898e21c5c1e32821dcb2c604b5e231071
7
- data.tar.gz: 825671cd8da1922aedd95746bdcb68a48a81e3cdebc4ea8822b36e3aa10349bef1a6bc97e7d4ca7ab0e51e6f3c2368deb7d9cb6a0d3ad93915d49036cb7ab4ca
6
+ metadata.gz: 8ef79654a460ec5c1a7f134aa3faba1c49793a51bbc93909b928e56c23b9157393a9f7e328318301069f75d2fa36c00999d87e400544db76a37c8a2a5efb134f
7
+ data.tar.gz: e78df6d8a039c2036c054d44eb422388847aea6a0bd34022d6964a70c0c8de38cb43d69100892416e81b43e4fcc099b6b4a8cb0494baafd35d322748ebb2e312
@@ -43,9 +43,10 @@ module ActiveRecord
43
43
  self.order(Arel::Nodes::RandomOrdering.new)
44
44
  end
45
45
 
46
+ # TODO: probably don't need to cast to sym
46
47
  def sort_for_column(column, options)
47
48
  column = self.arel_table[column.to_s.underscore]
48
- direction = (options.is_a?(Hash) ? options.keys.first.to_sym : options.to_s.downcase.to_sym)
49
+ direction = (options.is_a?(Hash) || options.is_a?(ActionController::Parameters) ? options.keys.first.to_sym : options.to_s.downcase.to_sym)
49
50
 
50
51
  nulls = (options.is_a?(Hash) ? options.values.first.to_sym : nil)
51
52
  if direction == :desc
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Sort
3
- VERSION = '6.0.0.1'
3
+ VERSION = '6.0.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sort
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.1
4
+ version: 6.0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-16 00:00:00.000000000 Z
11
+ date: 2019-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord