From 1a9770763f14fd965ae451ab4ac2c40c41c1b15b Mon Sep 17 00:00:00 2001 From: Sergio Cambra Date: Tue, 7 May 2024 17:43:45 +0200 Subject: [PATCH] use ActiveScaffold hook on initialization --- CHANGELOG.rdoc | 1 + lib/active_scaffold/finder.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index fc8d5866a..916f9d1b9 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -4,6 +4,7 @@ - Support loading jquery-ui externally, without jquery-ui-rails gem and ask AS to load JS/CSS for addons based on jquery-ui - Support usage with importmap - Add reset_form to search and field_search, when enabled, reset link will clear input fields in the search form, instead of refreshing the list without search and closing the form. +- Fix for mongoid 7 = 3.7.2 - Fix routes diff --git a/lib/active_scaffold/finder.rb b/lib/active_scaffold/finder.rb index 74e5abf3b..d92ecbf5d 100644 --- a/lib/active_scaffold/finder.rb +++ b/lib/active_scaffold/finder.rb @@ -618,7 +618,8 @@ def find_page(options = {}) options[:page] ||= 1 find_options = finder_options(options) - query = beginning_of_chain.where(nil) # where(nil) is needed because we need a relation + query = beginning_of_chain + query = query.where(nil) if active_scaffold_config.active_record? # where(nil) is needed because we need a relation # NOTE: we must use :include in the count query, because some conditions may reference other tables if options[:pagination] && options[:pagination] != :infinite