rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.08k stars 161 forks source link

Make ROM::Inflector configurable #495

Closed ianks closed 6 years ago

ianks commented 6 years ago

I ran into an issue when building adapter that required me to configure the inflector. In order to do this, I had to override the ROM::Inflector const. This PR makes it so the inflector can be configured. PS: A few rubocop autofixes are polluting the diff; let me know if you want me to take those out!

flash-gordon commented 6 years ago

hmm, we don't like global state => we'll have an injectable inflector in 5.0, I wonder if we need something in between in 4.0 @solnic

solnic commented 6 years ago

We can introduce it before 5.0.0 if somebody is willing to work on a solution where we use DI via option in all places where we use the inflector. I'm gonna close this PR because we don't want to have global config (like Nikita mentioned already).

ianks commented 6 years ago

@solnic Can you further specify the interface you would like to see for this? I'm happy to help but want to make sure I'm clear as to exactly what you want.

flash-gordon commented 6 years ago

@ianks see how cache passed around https://github.com/rom-rb/rom/search?utf8=%E2%9C%93&q=cache&type=