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: ad54f3d0e430c72b0e9607d11aa393d22e05fa004877a231bb3ea56da870cde0
4
- data.tar.gz: 4e99daf7cbd5d2d2b1fea577591fd115822b16f355d631a4990f858b811294c4
3
+ metadata.gz: 97928e9b633c9913eca0ee5b59dfa00f262e6737913de56fc418e806744d5b95
4
+ data.tar.gz: e6a905802155572d02e9e8eded99c084511e84d051f07c7041cf1fe0a099840d
5
5
  SHA512:
6
- metadata.gz: f2c6742b9cd6a9be676718add27c8394722ba121b5faad5f6f1f14024e902e7a98c2f8888aa20581e89250c5c929212c4953ac358de8ad4a03c18421d4f3abdf
7
- data.tar.gz: 0250b78198490e85fce003d3a8791fc110701e80ec4d1c6152b50660c904c3b1c015e4cec4f573ae5b12faa795d8a23b8c724b6fee34ddf9844712b2f3af9219
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.20.5'.freeze
2
+ VERSION = '2.20.6'.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.20.5
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-06 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails