Repository navigation
Fix open issues: empty exports, N+1 queries, Turbolinks, plural routes - #59
Merged
Merged
Conversation
- Accept a dashboard class or instance in ExporterService and read attributes via #attribute_types (#49) - Preload exported associations and use #size for HasMany to avoid N+1 queries (#40) - Build the export link with url_for(action: :export) so it works for models with plural names (#48) - Disable Turbolinks/Turbo on the export link so the CSV downloads (#26) - Enable transactional fixtures in specs
This was referenced Oct 21, 2026
This was referenced Oct 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses all currently open issues.
ExporterServicenow accepts either a dashboard instance or class, and reads fields viadashboard.attribute_typesinstead ofdashboard.class::ATTRIBUTE_TYPES. Added specs for empty results, searches with no matches, and passing the class.associative?fields with a matching reflection, excludingexport: false) are preloaded.HasManyusessizeinstead ofcountso it doesn't issue a COUNT per row. Query-count specs added. README documents preloading nested associations viascoped_resource.valid_action?#48 – The deprecation was already fixed in Fix compatibility with Administrate v1.0.0 #57. This also fixes the plural-model-name route problem raised in the comments by building the link withurl_for(action: :export, ...). README examples updated, including the authorization check.data-turbolinks="false"/data-turbo="false"so the CSV downloads instead of being rendered.association_includes.Also enables
use_transactional_fixturesin specs so examples don't leak records into each other.Known, unchanged:
find_eachignores the index sort order, so CSVs are always ordered by primary key.Fixes #49
Fixes #40
Fixes #48
Fixes #26
Closes #30