effective_resources 2.7.15 → 2.7.17
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d6b751ebab2af1f4b5ce1a6023628b4f71708c9201588827ca85b5463fddb94
|
4
|
+
data.tar.gz: 94016eb862f9a86023b4bbafc085ace95fe691b91a8d2306a7be8fd4496ce5dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84623889aa71be0d8a29af1c09c03392543ba979a8d0c9c488b2cf50b2907df38ff0944bb75c8276a87542b645064ba6f69038c96d3a69dca36a0ab43eb06e1b
|
7
|
+
data.tar.gz: e211971173259ea986f4f9fabb7801b5d1f161ec121b71bcdcadc1ab2e7869e37f1d7b4847b4e6d14cfc8953fba3a421dc443a5f59cd82dedefc3d6a67328a32
|
@@ -19,10 +19,33 @@ module Admin
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
def organizations
|
23
|
+
raise('the effective memberships gem is required') unless defined?(EffectiveMemberships)
|
24
|
+
|
25
|
+
klass = EffectiveMemberships.Organization
|
26
|
+
raise('an EffectiveMemberships.Organization is required') unless klass.try(:effective_memberships_organization?)
|
27
|
+
|
28
|
+
collection = klass.all
|
29
|
+
|
30
|
+
if collection.respond_to?(:to_select2)
|
31
|
+
collection = collection.to_select2
|
32
|
+
elsif collection.respond_to?(:sorted)
|
33
|
+
collection = collection.sorted
|
34
|
+
end
|
35
|
+
|
36
|
+
respond_with_select2_ajax(collection) do |organization|
|
37
|
+
{ id: organization.to_param, text: organization.try(:to_select2) || to_select2(organization) }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
22
41
|
private
|
23
42
|
|
24
|
-
def to_select2(
|
25
|
-
|
43
|
+
def to_select2(resource)
|
44
|
+
if resource.try(:email).present?
|
45
|
+
"<span>#{resource}</span> <small>#{resource.email}</small>"
|
46
|
+
else
|
47
|
+
"<span>#{resource}</span>"
|
48
|
+
end
|
26
49
|
end
|
27
50
|
|
28
51
|
end
|
@@ -61,7 +61,7 @@ module Effective
|
|
61
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("#{sql_column} #{sql_direction}"))
|
64
|
+
.order(Arel.sql(("ISNULL(#{sql_column}), " if mysql?).to_s + "#{sql_column}='' ASC, #{sql_column} #{sql_direction}" + (" NULLS LAST" if postgres?).to_s))
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
data/config/routes.rb
CHANGED
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.7.
|
4
|
+
version: 2.7.17
|
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: 2023-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|