You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a limitation with the way localising column names is implemented in the gem, as you can only decide to use, or dismiss localisation for the whole DSL block. My use case is mixed, requiring localising regular model attributes, and using key/value pairs that have been saved to the db directly for custom columns (skipping localisation for the key columns).
I did a quick patch that works for my needs, opting to only localise the columns if passed as a symbol, and when a scope exists. Strings are always titleized.
Hesitating to do a PR for this though, as it is in essence a breaking change to the way column localisation is handled. Perhaps a passable option for the column helper would be a better approach?
The text was updated successfully, but these errors were encountered:
I ran into a limitation with the way localising column names is implemented in the gem, as you can only decide to use, or dismiss localisation for the whole DSL block. My use case is mixed, requiring localising regular model attributes, and using key/value pairs that have been saved to the db directly for custom columns (skipping localisation for the key columns).
I did a quick patch that works for my needs, opting to only localise the columns if passed as a symbol, and when a scope exists. Strings are always titleized.
Hesitating to do a PR for this though, as it is in essence a breaking change to the way column localisation is handled. Perhaps a passable option for the column helper would be a better approach?
The text was updated successfully, but these errors were encountered: