# Dry-system: auto-registering properly cased class names

**URL:** <https://discourse.dry-rb.org/t/dry-system-auto-registering-properly-cased-class-names/374>\
**Category:** Support\
**Created:** [October 23, 2017, 8:18pm UTC](https://discourse.dry-rb.org/t/dry-system-auto-registering-properly-cased-class-names/374 "2017-10-23T20:18:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chastell](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/chastell/32/149_2.png) [@chastell](https://discourse.dry-rb.org/u/chastell)\
**Post date:** [October 23, 2017, 8:18pm UTC](https://discourse.dry-rb.org/t/dry-system-auto-registering-properly-cased-class-names/374/1 "2017-10-23T20:18:42Z")

</div>

Hello!

I’m trying to give dry-system a spin and everything seems to be working great except properly 😉 cased class names – e.g., my `STACsConfigRepo` class is not being registered under `stacs_config_repo` (dry-system looks for `StacsConfigRepo` instead).

I can side-step this by explicitly registering these cases with

```ruby
register('stacs_config_repo') { STACsConfigRepo.new }

```

but I was wondering whether there is a better option. I have quite a few classes named like this (beggining with `STAC` and `SC`) and would much rather not have to special-case all of them.

A cursory look at the way dry-system resolves this (unsing the inflecto gem to create the class name from the key) seems to suggest this is not something easily fixable, but just wanted to double-check / fish for ideas.

Thanks so much for dry-system! I’m looking forward to rooting all of the explicit `require_relative`s and hard-coded class names from my code. 👍

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [October 24, 2017, 11:01am UTC](https://discourse.dry-rb.org/t/dry-system-auto-registering-properly-cased-class-names/374/2 "2017-10-24T11:01:04Z")

</div>

Hey hey!

I’m happy to see you here 🙂 This is actually something that we can workaround by switching to `Dry::Core::Inflector` (I’ve no idea why I used `Inflecto` directly). The difference is that `Dry::Core::Inflector` can be configured with different inflection backends, so ie you could use `ActiveSupport::Inflector` (sad truth is that it’s still the best solution) and add custom inflection for your classes.

FWIW, we’re working on `dry-inflector` gem which eventually will be ready, and it will support adding custom inflections (and won’t have monkey-patches, and will be more flexible, and faster, and nicer).

Cheers!

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [October 24, 2017, 11:01am UTC](https://discourse.dry-rb.org/t/dry-system-auto-registering-properly-cased-class-names/374/3 "2017-10-24T11:01:51Z")

</div>

ps. please report an issue about the fact we’re using `inflecto` directly, this is a mistake and we gotta fix.
