effective_resources 2.26.2 → 2.26.4

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: 1a5f21cf765885ef02922b5b777b6b6da135f73c7e3aa8ef2b7707afeccdd473
4
- data.tar.gz: 5e675ad42c234a38429331f6c25da8c81700e89bc0a13561918b9a0727dde7fc
3
+ metadata.gz: 8507812d45368ac596afd480886b529006507dc363a574e05aacefccce2a8b18
4
+ data.tar.gz: 1dd9dd8273cc3a74e797864ecd597afac57bad4c6bc0b774f969e25e74de007b
5
5
  SHA512:
6
- metadata.gz: cc2a99f88bbf80daf7fd0aa9113ebff4187577e99c636b5883927295cf6e55346be9a89fe9699e1589f1b9532d6f6ea24f708b6890d5991dd55d7759a930b167
7
- data.tar.gz: c1446888c6427ac4d3f94db77807124826d269b0c3189cee9dd85c0deaa424cf7e0d84d145e776ca8a74c2f08bb804cce4ac2066e5a41f51d2ece5b1ec86bdf9
6
+ metadata.gz: 3a7f41b89fb809d0a8bea628fc12105e6b5702b3d5a749ae34983c620141f51dc7fff213b03cd2dcfaf458107f578c2ab5a37bbc6de6bc9c09c952e022902413
7
+ data.tar.gz: 0b8bb4f38bd0ba4d1a7ceb96d354c055fa289f73363d8ff17694c2b4145a2d8064702c7594be6b6c96d9434665aca70e61b09fc1b4dffa6d28474870556115db
@@ -127,7 +127,7 @@ module ActsAsWizard
127
127
  end
128
128
 
129
129
  def default_wizard_step_title(step)
130
- self.class.const_get(:WIZARD_STEPS).fetch(step)
130
+ self.class.const_get(:WIZARD_STEPS)[step] || step.to_s.titleize
131
131
  end
132
132
 
133
133
  def first_completed_step
@@ -127,13 +127,15 @@ module Effective
127
127
  else # Maybe from a string field
128
128
  associated = relation.none
129
129
 
130
+ value_ids_integer_array = (value_ids.kind_of?(Array) && value_ids.length > 0 && value_ids.all? { |value| (value.to_i rescue nil).to_s == value })
131
+
130
132
  relation.unscoped.distinct(foreign_type).pluck(foreign_type).each do |klass_name|
131
133
  next if klass_name.nil?
132
134
 
133
135
  resource = Effective::Resource.new(klass_name)
134
136
  next unless resource.klass.present?
135
137
 
136
- associated = associated.or(relation.where(foreign_id => value_ids, foreign_type => klass_name))
138
+ associated = associated.or(relation.where(foreign_id => (value_ids_integer_array ? value_ids : resource.search_any(value)), foreign_type => klass_name))
137
139
  end
138
140
 
139
141
  case operation
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.26.2'.freeze
2
+ VERSION = '2.26.4'.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.26.2
4
+ version: 2.26.4
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-11-07 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails