pokonski/public_activity — pull request #154 by AndrewRadev (2014-06-19 10:17:20+00:00)
Title: Allow customizing the model name

The `Activity` model comes from the gem, which means it's not very convenient to customize. I'd rather have a domain model in my app that I can extend. It's still somewhat possible to plug custom extensions with an initializer that monkey-patches the `::PublicActivity::Activity` class, but this doesn't work well with autoloading and it has to be placed in a different location than all other models.

The change needed to support this is actually quite simple, the string `::PublicActivity::Activity` is replaced with a config option. This should provide perfect backwards compatibility and a new hook to plug in your own class (in my case, `class ::Activity < ::PublicActivity::Activity`) that is a full-fledged AR model, owned by the app.

Let me know if you'd like me to add more tests or documentation, I wasn't sure how far I should go in that direction.