Skip to content

StreamRails::Activity overwrites activity_object method, breaks generic approach to Activity Objects #90

@thisismydesign

Description

@thisismydesign

Our current approach to handle a generic activity type is to use STI with the base model ActivityObject and specific child models. It would be used as:

class Activity < ApplicationRecord
  include StreamRails::Activity
  as_activity

  belongs_to :user
  has_one :activity_object

  # ...
end

This approach, however, doesn't work because stream-rails overwrites methods such as activity_object.

I understand the recommended approach is to create specific Activity models and reference specific Activity Objects, however, it seems to us that the generic method would work just fine as well.

Is there a specific reason why stream-rails doesn't support this approach? Are there any possible issues we're missing with this approach?

Would you consider changing this behavior or accepting a PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions