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

Found a missing edge case with polymorphic has_many relationship #2

Open
pvertenten opened this issue Oct 12, 2012 · 0 comments
Open

Comments

@pvertenten
Copy link

Looks like the following edge cased does not get counted.

class User
  include Mongoid::Document
  include Mongoid::Max::Denormalize

  has_many :followers, :class_name => "Follow",  :as => :subject
  denormalize :followers, :count => true
end

class Follow
  include Mongoid::Document
  include Mongoid::Timestamps

  belongs_to :user
  belongs_to :subject, :polymorphic => true

  validates_presence_of :user, :subject
end
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

1 participant