Skip to content

Update db service#79

Merged
blocknotes merged 2 commits intomainfrom
update-db-service
Mar 15, 2026
Merged

Update db service#79
blocknotes merged 2 commits intomainfrom
update-db-service

Conversation

@blocknotes
Copy link
Copy Markdown
Owner

fix: Call sanitize_sql_like on ActiveRecord::Base

Change ApplicationRecord.sanitize_sql_like to ActiveRecord::Base.sanitize_sql_like. The bare ApplicationRecord reference was resolving to the host app's class rather than the gem's namespaced ActiveStorageDB::ApplicationRecord. Using ActiveRecord::Base is correct since sanitize_sql_like is defined there and avoids any dependency on the host app's class hierarchy.


chore: Apply annotate properly inside object_for

Refactor object_for so .annotate(comment) is always applied, not only when fields is present. Previously, full-file downloads and integrity checks produced unannotated SQL queries, making them harder to trace in production logs.

Change `ApplicationRecord.sanitize_sql_like` to `ActiveRecord::Base.sanitize_sql_like`. The bare `ApplicationRecord` reference was resolving to the host app's class rather than the gem's namespaced `ActiveStorageDB::ApplicationRecord`. Using `ActiveRecord::Base` is correct since `sanitize_sql_like` is defined there and avoids any dependency on the host app's class hierarchy.
@blocknotes blocknotes self-assigned this Mar 15, 2026
Refactor `object_for` so `.annotate(comment)` is always applied, not only when fields is present. Previously, full-file downloads and integrity checks produced unannotated SQL queries, making them harder to trace in production logs.
@blocknotes blocknotes marked this pull request as ready for review March 15, 2026 10:39
@blocknotes blocknotes merged commit b31d607 into main Mar 15, 2026
30 checks passed
@blocknotes blocknotes deleted the update-db-service branch March 15, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant