-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Allow to configure custom inflector #591
Conversation
@flash-gordon wouldn't it be better to just have |
@solnic I don't know yet. It's kinda experiment, things like this allow to learn more about your code. Overall, I think inflector should be injectable. This may be not an issue for me personally but for Hanami user/developer relying on a global state is a well-known PITA. Code-wise it seems to be not that bad. |
@flash-gordon yeah I hear you. It was just an immediate thought I had when I looked at the diff. |
539a85b
to
ad4ac13
Compare
@solnic apart from failing specs on 2.4 it's ready to go and I believe it's worth it. The changes are not radical and it brings some flexibility. Of course, it won't work when you instantiate two containers with different inflectors but the same relation classes but this case doesn't exist in the real world I'm sure. |
@flash-gordon I'm sorry but I forgot about this PR and now we have a bunch of conflicts. Do you want this in 5.x or just 6.0? |
@solnic np, I'll rebase today, it's for 6.0 |
c21f124
to
d609d9c
Compare
done |
3e6a3fc
to
a51556b
Compare
All components that rely on inflector use an injected inflector now rather than using a global
ROM::Inflector
. This makes it possible to configure a custom inflector like that: