Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thisismydesign opened this issue Feb 28, 2019 · 1 comment

Comments

@thisismydesign
Copy link

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?

@mircea-cosbuc
Copy link

Hi @thisismydesign ! I think that this approach could be supported and we would welcome a PR. If you'd like to provide a more detailed draft of what you're trying to accomplish, we could consider it while updating the rails SDK, there's a couple of features in https://github.com/GetStream/stream-ruby we want to bring in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants