ankane / blazer

Business intelligence made simple
MIT License
4.5k stars 471 forks source link

[Idea] Add Configuration Option to Override `pluralize_table_names` Setting #475

Closed avinhurry closed 3 months ago

avinhurry commented 3 months ago

Hi,

Our application has set ActiveRecord::Base.pluralize_table_names = false to use singular table names across the app. However, we need Blazer to use plural table names for its models.

Currently, we have to monkey patch Blazer::Record to set pluralize_table_names to true. This approach works but isn't ideal as it requires modifying the Blazer source code.

To make this easier for others who might encounter the same issue, I'd like to suggest adding a configuration option in Blazer to override the pluralize_table_names setting. Something like:

Blazer.pluralize_table_names = true

This would simplify the configuration for apps with custom Active Record settings.

ankane commented 3 months ago

Hi @avinhurry, you can set Blazer::Record.pluralize_table_names = true in an initializer without modifying the Blazer source code.

avinhurry commented 3 months ago

Thank you! @ankane