katalyst / koi

Koi Gem
https://github.com/katalyst/koi
MIT License
8 stars 4 forks source link

Best practice for extending Admin::User model #574

Open mattr opened 6 months ago

mattr commented 6 months ago

The Admin::User model from Koi is not directly present in the generated application. This leads to potential issues if we need to extend the model for app-specific behaviour.

I see three main avenues for extending the model:

  1. Copy the model from Koi into the application wholesale;
  2. Extend the model in the application; or
  3. Extend the model via initializers.

Each option has benefits and drawbacks and may be suitable in different situations. For example, 3 might be a preferred approach if we are just adding a concern to the model. 1 is the simplest solution but 2 reduces the additional boilerplate.

We want to document our preferred approach(es) and in which situations they would be most applicable.