From 6800c60427865907ed9220984118741ff8aec903 Mon Sep 17 00:00:00 2001 From: Sergio Cambra Date: Tue, 3 Dec 2024 19:59:52 +0100 Subject: [PATCH] fix exists? on tableless association --- lib/active_scaffold/tableless.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/active_scaffold/tableless.rb b/lib/active_scaffold/tableless.rb index 90231264b..5395bf5db 100644 --- a/lib/active_scaffold/tableless.rb +++ b/lib/active_scaffold/tableless.rb @@ -58,6 +58,14 @@ module TablelessCollectionAssociation def get_records # rubocop:disable Naming/AccessorMethodName klass < ActiveScaffold::Tableless ? scope.to_a : super end + + def reader + super.tap do |proxy| + if klass < ActiveScaffold::Tableless + def proxy.exists?(...) = scope.exists?(...) + end + end + end end module CollectionAssociation