You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got an undefined method when trying to create an object that is currently being tracked while using Mongoid.
Using Rails 7.1.3
Ruby 3.3.3
public_activity the latest version.
class Lead
include Mongoid::Document
include PublicActivity::Model
tracked
belongs_to :user
has_many :lead_messages
has_many :campaign_user_lists
accepts_nested_attributes_for :lead_messages
The text was updated successfully, but these errors were encountered:
@jakepham90 Indeed, there’s no such method defined by the gem. It could be our outdated Mongo integration. I just had a quick look at the Mongoid gem and #criteria is seems to be used in many places there. Could you try to submit a PR?
I have the same issue here and I'm trying to understand where this is coming from as well. #criteria is the generic mongoid db (select) criteria as far as I know but it seems to be firing on save. Perhaps the mongoid code is trying to read the model but it's hard to tell. Comment if you've found a solution. I'm trying to get this working on Rails 8 with Mongoid.
I managed to partially fix this by monkey patching PublicActivity like this, in the initializer.
At least now I can access the Activity model again from my app.
# config/initializers/public_activity.rb
PublicActivity::Config.set do
orm :mongoid
end
module PublicActivity
class Activity < inherit_orm("Activity")
end
end
I got an undefined method when trying to create an object that is currently being tracked while using Mongoid.
Using Rails 7.1.3
Ruby 3.3.3
public_activity the latest version.
class Lead
include Mongoid::Document
include PublicActivity::Model
tracked
belongs_to :user
has_many :lead_messages
has_many :campaign_user_lists
accepts_nested_attributes_for :lead_messages
The text was updated successfully, but these errors were encountered: