We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have this test:
RSpec.describe Product do it "chech bug" do class User include Mongoid::Document include Mongoid::Userstamp::User end class Product include Mongoid::Document include Mongoid::Userstamp end p = Product.create expect(p.created_by).to be eq(nil) end end
This show this error:
1) Product chech bug Failure/Error: p.created_by NoMethodError: undefined method `created_by' for #<Product _id: 572c8a3f8675c36e39000001, >
The problem that I can see is that this code:
module Mongoid module Userstamp class Railtie < Rails::Railtie config.to_prepare do Mongoid::Userstamp.model_classes.each do |model_class| unless model_class.included_modules.include?(Mongoid::Userstamp::Model) model_class.send(:include, Mongoid::Userstamp::Model) end end end
Is executed before Mongoid::Userstamp is included in class:
module Mongoid module Userstamp extend ActiveSupport::Concern included do Mongoid::Userstamp.add_model_class(self) end ...
Then Mongoid::Userstamp.model_classes is equal to []
Mongoid::Userstamp.model_classes
[]
It is a bug?
The text was updated successfully, but these errors were encountered:
Hey @rjurado01 I tried to set the user_model on the tracked models and that worker. Just put mongoid_userstamp user_model: 'User' :)
mongoid_userstamp user_model: 'User'
Sorry, something went wrong.
No branches or pull requests
I have this test:
This show this error:
The problem that I can see is that this code:
Is executed before Mongoid::Userstamp is included in class:
Then
Mongoid::Userstamp.model_classes
is equal to[]
It is a bug?
The text was updated successfully, but these errors were encountered: