effective_datatables 4.32.2 → 4.33.0

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: 9100f94b25b41b063bfb22badd52d44a013841a9a8777f82c46c603a9253037a
4
- data.tar.gz: 4865f6a29fb6537c7c78ae86bfb3694291ac9c0f1602bae6b316ae1f740332f5
3
+ metadata.gz: 4fd39e83bcebfbf1f8dbe2b17d3d54027859a029171415cc474967fc86393748
4
+ data.tar.gz: 695f261ebd015f4caa869f8324576826a6189281e8beefcce2f7981b4787f800
5
5
  SHA512:
6
- metadata.gz: 5b586704013a3f4cab49e372a7c4b2f72c61b3167ee51fd332d08d914370226388a1b84f758aa342c4dbd57396e02929ce93ed4909806df5d35e119ffcb25d10
7
- data.tar.gz: f3313ae916189ab08285a3a4eda9641928c1a623bb7827c9935c85eca8eeeaad3dc6c0c93ff6e2f0602bc03e8e46f671275e74b337f3f10e5128eb19b674b79f
6
+ metadata.gz: e81d92cd5969c55cac79164365927833cea5468eb6c5fc9e0490637b04ee409791f6c9146702b086d48817f00cfedfd4d15447560a42cafc9910e28441e85a9c
7
+ data.tar.gz: ce1c67eab48ee5f3099046beaed44a9c92e2a1dfca154e1847093feef0d00ba4215e00776153190a4d924942695c5bb76e30b9aa1f94827cb499db94287011f3
@@ -201,9 +201,16 @@ module Effective
201
201
  # Nothing to do. We're just a string search.
202
202
  elsif search[:as] == :select && search[:collection].kind_of?(Array)
203
203
  # Nothing to do. We already loaded the custom parameterized collection above.
204
- elsif array_collection? && opts[:resource].present?
204
+ elsif search[:as] == :select && search[:collection].blank? && array_collection? && opts[:resource].present?
205
205
  # Assigns { as: :select, collection: [...] }
206
206
  search.reverse_merge!(search_resource.search_form_field(name, collection.first[opts[:index]]))
207
+ elsif search[:as] == :select && search[:collection].blank?
208
+ # Load the defaults from effective_resources
209
+ # Assigns { as: :string } or { as: :select, collection: [...] }
210
+ search.reverse_merge!(search_resource.search_form_field(name, opts[:as]))
211
+ elsif [:belongs_to, :belongs_to_polymorphic, :has_and_belongs_to_many, :has_many, :has_one].include?(opts[:as])
212
+ # Do not eager load the collection. Treat this as a string search.
213
+ search.reverse_merge!({ as: :string })
207
214
  else
208
215
  # Load the defaults from effective_resources
209
216
  # Assigns { as: :string } or { as: :select, collection: [...] }
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.32.2'.freeze
2
+ VERSION = '4.33.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.32.2
4
+ version: 4.33.0
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: 2025-04-10 00:00:00.000000000 Z
11
+ date: 2025-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails