I'm trying to decorate a collection of activities created by the public_activity gem using Draper.
However, it appears that PublicActivity::Activity doesn't inherit from ActiveRecord (am I right in assuming that?) so I need to add include Draper::Decoratable
to the model, but where is that PublicActivity model exactly?
Btw, this is the error I'm getting:
Could not infer a decorator for PublicActivity::Activity.
Well, it turns out that this won't work:
I'm guessing this is because the namespaced query
PublicActivity::Activty
doesn't inherit from ActiveRecord and therefore doesn't includeDraper::Decoratable
, but I'm not sure. Please correct me if I'm wrong.However, with Draper you can decorate objects as well as queries, so this does work...
The decorator must also include
decorates PublicActivity::Activity