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

Error in Rails 6 #339

Open
wernerlaude opened this issue May 31, 2019 · 19 comments
Open

Error in Rails 6 #339

wernerlaude opened this issue May 31, 2019 · 19 comments
Assignees

Comments

@wernerlaude
Copy link

I have:
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
include PublicActivity::StoreController

class Documentation < ApplicationRecord
include PublicActivity::Model
tracked owner: Proc.new{ |controller, model| controller.current_user }

and i get:
unknown attribute 'owner' for PublicActivity::Activity.
Not working in Rails6?
Thanks for help.

@rajraj
Copy link

rajraj commented Jun 5, 2019

@wernerlaude using master branch seems to have fixed this issue for me,

gem 'public_activity', github: 'chaps-io/public_activity', branch: 'master'

@wernerlaude
Copy link
Author

Thanks..

@dmitry
Copy link

dmitry commented Jul 2, 2019

Could be closed after the release :)

@pokonski
Copy link
Member

pokonski commented Jul 16, 2019

master is not releasable, so not sure how that fixed the issue for Rails 6, It's a 2 years old branch 😁

Can you try 1-6-stable branch?

@tbuehlmann
Copy link

Confirmed, it works with Rails 6.0.0.rc1 and the 1-6-stable branch.

@jesperronn
Copy link

Since Rails 6 is coming up, could you make a release of the 1-6 branch so that everybody are able to test if the rest of their application are releasable with Rails 6.

@hllewelyn
Copy link

Any news on a release that's compatible with Rails 6?

@pokonski
Copy link
Member

pokonski commented Sep 30, 2019

Hey guys, I released 1.6.4, can you please try if it helped? /cc @hllewelyn @jesperronn @tbuehlmann @dmitry

@pduersteler
Copy link

Just tried it out, switching from the 1-6-stable branch to 1.6.4 seems to work for me.

@Feuda
Copy link

Feuda commented Nov 25, 2019

As of 1.6.4 version, I have Rails 6 and Mongoid with mongoid orm configration, but I got ActiveRecord::ConnectionNotEstablished...No connection pool with 'primary' found, the Database setup seems did not take effect. @pokonski

@ntloi95
Copy link

ntloi95 commented Apr 22, 2020

I have a same issue with Feuda when using with MongoId
ActiveRecord::ConnectionNotEstablished...No connection pool with 'primary' found

@dfabreguette
Copy link

same issue here, pretty blocking. Has anyone a workaround for that ?

@dmitry
Copy link

dmitry commented Feb 24, 2021

@dfabreguette-ap seems like repo is abandoned, you can check some forks here: https://github.com/chaps-io/public_activity/network

@ur5us
Copy link
Collaborator

ur5us commented Oct 29, 2023

@Feuda @dfabreguette @dmitry Is that still a problem for you? Development stalled for a while but overall this gem is not abandoned; quite the opposite. However, personally, I have no need for Mongo, so not sure the adapters even work at this point. I’ll happily accept a patch. Otherwise, I might remove the Mongo adapters entirely.

@noctivityinc
Copy link

@ur5us good to hear. Do you have a fix for this issue. I have the exact same problem in Rails 7. I get things like

rails | NoMethodError (protected method `current_user' called for an instance of ItemsController):

when everything is setup as per the 2012 docs

@ur5us
Copy link
Collaborator

ur5us commented Aug 9, 2024

@noctivityinc Not in front of my computer but it looks like the current_user method is not public so you'd need to adapt the following line:

# change this
tracked owner: Proc.new{ |controller, model| controller.current_user }
# to this
tracked owner: Proc.new{ |controller, model| controller.send :current_user }

@noctivityinc
Copy link

noctivityinc commented Aug 12, 2024 via email

@Feuda
Copy link

Feuda commented Oct 1, 2024

@Feuda @dfabreguette @dmitry Is that still a problem for you? Development stalled for a while but overall this gem is not abandoned; quite the opposite. However, personally, I have no need for Mongo, so not sure the adapters even work at this point. I’ll happily accept a patch. Otherwise, I might remove the Mongo adapters entirely.

Sorry for the late response, I think YES, I removed it from Gemfile and quite

@ur5us
Copy link
Collaborator

ur5us commented Oct 3, 2024

@noctivityinc I haven’t tried it but I’d expect Current to work, also. If you try it and it doesn’t then please file an issue.

@ur5us ur5us self-assigned this Oct 3, 2024
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