Skip to content

Commit

Permalink
fix exists? on tableless association
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Dec 3, 2024
1 parent a5d9410 commit 6800c60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/active_scaffold/tableless.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6800c60

Please sign in to comment.