effective_resources 2.20.5 → 2.20.6
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: 97928e9b633c9913eca0ee5b59dfa00f262e6737913de56fc418e806744d5b95
|
4
|
+
data.tar.gz: e6a905802155572d02e9e8eded99c084511e84d051f07c7041cf1fe0a099840d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff222ec2cf0e39d721d08fcffe0c2da186370fc10d1dd062cdcf0f348d30a7e072ead4a963d950b44c274a0e824dd7504a5b661d4400b00e7abfd93396b638f7
|
7
|
+
data.tar.gz: 429ff43ed3b1f2b09e93cc734c9b9d482271fa62df210663ce7e422ba785889777e222d571627cebde925db909de26004633208f7b00ec6753c18a8028241f85
|
@@ -37,17 +37,5 @@ module Admin
|
|
37
37
|
{ id: organization.to_param, text: organization.try(:to_select2) || to_select2(organization) }
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
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
|
49
|
-
end
|
50
|
-
|
51
40
|
end
|
52
|
-
|
53
41
|
end
|
@@ -2,11 +2,11 @@ module Effective
|
|
2
2
|
module Select2AjaxController
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
|
-
def respond_with_select2_ajax(collection, skip_search: false, &block)
|
5
|
+
def respond_with_select2_ajax(collection, skip_search: false, skip_authorize: false, &block)
|
6
6
|
raise('collection should be an ActiveRecord::Relation') unless collection.kind_of?(ActiveRecord::Relation)
|
7
7
|
|
8
8
|
# Authorize
|
9
|
-
EffectiveResources.authorize!(self, :index, collection.klass)
|
9
|
+
EffectiveResources.authorize!(self, :index, collection.klass) unless skip_authorize
|
10
10
|
|
11
11
|
# Scope
|
12
12
|
if collection.respond_to?(:select2_ajax)
|
@@ -49,5 +49,15 @@ module Effective
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
private
|
53
|
+
|
54
|
+
def to_select2(resource)
|
55
|
+
if resource.try(:email).present?
|
56
|
+
"<span>#{resource}</span> <small>#{resource.email}</small>"
|
57
|
+
else
|
58
|
+
"<span>#{resource}</span>"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
52
62
|
end
|
53
63
|
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.20.
|
4
|
+
version: 2.20.6
|
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: 2024-05-
|
11
|
+
date: 2024-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|