Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log messages for #insert_all / #upsert_all` etc. methods #35892

Merged
merged 1 commit into from Apr 8, 2019

Conversation

ryohashimoto
Copy link
Contributor

@ryohashimoto ryohashimoto commented Apr 8, 2019

Summary

In #35077, #insert_all / #upsert_all / #insert / #upsert etc. methods are added. But Active Record logs only “Bulk Insert” log messages when they are invoked.

This pull request improves the log messages to use correct words for how invoked them.

Book.insert_all [{ name: "Remote", author_id: 1 }, { name: "Renote", author_id: 1 }]
  • Before: Bulk Insert (0.5.ms)
  • After: Book Bulk Insert (0.5.ms)
Book.upsert_all [{ name: "Remote", author_id: 1 }, { name: "Renote", author_id: 1 }]
  • Before: Bulk Insert (0.5.ms)
  • After: Book Bulk Upsert (0.5.ms)
Book.insert(name: "Rework", author_id: 1)
  • Before: Bulk Insert (0.5.ms)
  • After: Book Insert (0.5.ms)
Book.upsert(name: "Rework", author_id: 1)
  • Before: Bulk Insert (0.5.ms)
  • After: Book Upsert (0.5.ms)

…#upsert etc. methods

In rails#35077, `#insert_all` / `#upsert_all` / `#insert` / `#upsert` etc. methods are added. But Active Record logs only “Bulk Insert” log messages when they are invoked.

This commit improves the log messages to use collect words for how invoked them.
@eileencodes eileencodes merged commit 27c3ad0 into rails:master Apr 8, 2019
@ryohashimoto ryohashimoto deleted the bulk_insert_logs branch April 8, 2019 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants