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 +4 -4
- data/ext/active_record/base.rb +2 -1
- data/lib/active_record/sort/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cff1abfec5ff89217d35624be89876e6f88943250f3da263d39caf520fa20b9b
|
4
|
+
data.tar.gz: 7ce1af43d5e20dea32de13d1b542b6efa6f43b6a94a18bfabffb319740fedba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ef79654a460ec5c1a7f134aa3faba1c49793a51bbc93909b928e56c23b9157393a9f7e328318301069f75d2fa36c00999d87e400544db76a37c8a2a5efb134f
|
7
|
+
data.tar.gz: e78df6d8a039c2036c054d44eb422388847aea6a0bd34022d6964a70c0c8de38cb43d69100892416e81b43e4fcc099b6b4a8cb0494baafd35d322748ebb2e312
|
data/ext/active_record/base.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|