rails / solid_queue

Database-backed Active Job backend
MIT License
1.95k stars 130 forks source link

solid_queue:install doesn't take config.active_record.pluralize_table_names in consideration #396

Closed dviana19 closed 3 weeks ago

dviana19 commented 3 weeks ago

Hi,

I normally use this configuration config.active_record.pluralize_table_names = false, which brings me to this issue. I've upgraded an application to Rails 8 to use Solid Queue. However, when I run the command solid_queue:install, it just copies the template with the table names in the plural.

But in development, Solid Queue uses async so I only found out the issue in production when I got "could not find the table solid_queue_blocked_executions..."

Of course, it's an easy fix by just changing the name to singular inside of queue_schema.rb, but I'm wondering if this could be done already in the generator.

rosa commented 3 weeks ago

Oh yes! This came up in https://github.com/rails/solid_queue/pull/354 and, in Rails too, as Active Storage or Action Mailbox behave in the same way: https://github.com/rails/rails/pull/52970#discussion_r1770733592. I think for now this should be documented instead of handling it explicitly, just like it was suggested over in that Rails PR.

dviana19 commented 3 weeks ago

Thank you, @rosa. I'll close this issue.