effective_resources 2.0.4 → 2.1.0

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: 5179c0bb8855a9265428e895d5ba520ca3c30fc4a0e4a5f08d2cbe026bf7801a
4
- data.tar.gz: 9c5e6364e79d82e6f4419f114f24fffc77431ce2e793c241b387c0c97b38b542
3
+ metadata.gz: 22b266fe036432aaf679e5a695edcea2d17639a1bc5e1fa082d93b1317cdd1e7
4
+ data.tar.gz: dc3b135919307b5735aa5f34bb79633fa1532f2dbe9702ad995fad89e8886d7f
5
5
  SHA512:
6
- metadata.gz: 84c8b8610fe599ac1c1c7ee706bed4fe5b5575f7a66aef64f37b51a27ed589a49bb788fba3984870a078528af397ada56208629d1c51b558fd0e3e66385a701e
7
- data.tar.gz: 8717b561cdf65de63cb5e3b7dc6a84c41ba9347bc08dfef01000ed91f2c2a6ad79708b6ca7554382d07a1da52ed99afb70e17b69463c2e9ea54ec8f8bbecfe79
6
+ metadata.gz: 757ba49ce72d18d953634a6baf91b4f71292cf04a55475808ef417970697470531d2f06c7db77356f2768f95c7fd85c05d3fde186b0c1a125f927e8af2882687
7
+ data.tar.gz: dea57f166262cbeeb8e43d7c2e730ab0b59c1eb43bc31e67f29801055128425c9414397d3050a508fb8872021280a5818da8fc7b087493d525040d03464609f9
@@ -49,19 +49,19 @@ module Effective
49
49
  .order(order_by_associated_conditions(associated(:addresses), sort: sort, direction: direction, limit: limit))
50
50
  .order(Arel.sql("#{sql_column(klass.primary_key)} #{sql_direction}"))
51
51
  when :active_storage
52
- relation.send("with_attached_#{name}").references("#{name}_attachment")
52
+ relation
53
+ .send("with_attached_#{name}")
54
+ .references("#{name}_attachment")
53
55
  .order(Arel.sql("active_storage_blobs.filename #{sql_direction}"))
54
56
  when :effective_roles
55
- relation.order(Arel.sql("#{sql_column(:roles_mask)} #{sql_direction}"))
56
- when :string, :text
57
57
  relation
58
- .order(Arel.sql(("ISNULL(#{sql_column}), " if mysql?).to_s + "#{sql_column}='' ASC, #{sql_column} #{sql_direction}" + (" NULLS LAST" if postgres?).to_s))
59
- when :time
60
- relation
61
- .order(Arel.sql(("ISNULL(#{sql_column}), " if mysql?).to_s + "EXTRACT(hour from #{sql_column}) #{sql_direction}, EXTRACT(minute from #{sql_column}) #{sql_direction}" + (" NULLS LAST" if postgres?).to_s))
58
+ .order(Arel.sql("#{sql_column(:roles_mask)} #{sql_direction}"))
59
+ when :time
60
+ relation
61
+ .order(Arel.sql("EXTRACT(hour from #{sql_column}) #{sql_direction}, EXTRACT(minute from #{sql_column}) #{sql_direction}"))
62
62
  else
63
63
  relation
64
- .order(Arel.sql(("ISNULL(#{sql_column}), " if mysql?).to_s + "#{sql_column} #{sql_direction}" + (" NULLS LAST" if postgres?).to_s))
64
+ .order(Arel.sql("#{sql_column} #{sql_direction}"))
65
65
  end
66
66
  end
67
67
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.0.4'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.1.0
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: 2022-10-24 00:00:00.000000000 Z
11
+ date: 2022-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails