effective_resources 2.0.4 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fdc93f33038497592b4ddb1c493191567d6c85e995fbf81eee114ed24c0c690
|
4
|
+
data.tar.gz: a93e21e2cdb21e570bd60ba383bfcb5eb3ce561c7ec87a5420141912c8e24c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8d8b01b110fc396d02a8a813e2bfe5aa3d072f23141c3cf4c91033c5a4fe12ee46ba745b7175bee21cd811b1d90bf25c5631e2fe2f33c5aafe0cb94e251eedb
|
7
|
+
data.tar.gz: f857d31677d5519415cbe90804e4a707f21eb8b89b5ef9d36ae207686f9c4236c27b251d0fdd76a4721b7e49b42f3082edd53c2199997566e8faface7986480d
|
@@ -36,20 +36,20 @@ module EffectiveResourcesPrivateHelper
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# Replace resource name in any token strings
|
39
|
-
if opts
|
40
|
-
opts['data-confirm'] = opts['data-confirm'].gsub('@resource'
|
39
|
+
if opts.key?('data-confirm') && opts['data-confirm'].to_s.include?('@resource')
|
40
|
+
opts['data-confirm'] = opts['data-confirm'].gsub('@resource', resource_to_s)
|
41
41
|
end
|
42
42
|
|
43
43
|
# Assign class
|
44
44
|
opts[:class] ||= (
|
45
|
-
if opts['data-method'.
|
46
|
-
'btn btn-danger'
|
45
|
+
if opts['data-method'].to_s == 'delete'
|
46
|
+
'btn btn-danger'
|
47
47
|
elsif h.length == 0
|
48
|
-
'btn btn-primary'
|
48
|
+
'btn btn-primary'
|
49
49
|
elsif defined?(EffectiveBootstrap)
|
50
|
-
'btn btn-secondary'
|
50
|
+
'btn btn-secondary'
|
51
51
|
else
|
52
|
-
'btn btn-default'
|
52
|
+
'btn btn-default'
|
53
53
|
end
|
54
54
|
)
|
55
55
|
|
@@ -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
|
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(
|
59
|
-
|
60
|
-
|
61
|
-
|
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(
|
64
|
+
.order(Arel.sql("#{sql_column} #{sql_direction}"))
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
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.
|
4
|
+
version: 2.1.1
|
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-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|