Search code examples
ruby-on-railsinheritanceflipper

Flipper with inheritance


I'm facing an issue with Flipper which is actually not really one.

I have a User on the mail app an MyEngine::User on an engine MyEngine.

# implementation in the engine
class MyEngine::User < User
  # ...
end
User.first.flipper_id
# => User;1

MyEngine::User.first.flipper_id
# => MyEngine::User;1

But actually, User;1 and MyEngine::User;1 are the same user. To avoid this, I need to make as many records on Flipper as I have subclasses defined on each engine. It's painful.

Should I pipe the normal Flipper.enabled?(:something, user) with a group where I check the inheritance? It's a bit ugly isn't it?


Solution

  • Issued raised on the gem. Here is the PR#758