Skip to content
This repository was archived by the owner on Nov 13, 2021. It is now read-only.
This repository was archived by the owner on Nov 13, 2021. It is now read-only.

Zero reputations result in a non zero reputation when sum #97

Description

@thebravoman

Definition is:

has_reputation :popularity,
    :source => [
      {:reputation => :watched_pointsd},
      {:reputation => :views},
      {:reputation => :payment_reputation, :weight => 2}
    ],
    :aggregated_by => :sum

  has_reputation :payment_reputation,
    :source => :episode,
    :source_of => [{:reputation=>:popularity}]

  has_reputation :views,
    :source=>:user,
    :source_of => [{:reputation=>:popularity}]

	has_reputation :watched_points,
		:source=>:user,
    :source_of => [{:reputation=>:popularity}]

Then for a given episode I have

def pop e 
 puts "Popularity: #{e.reputation_for(:popularity)}" 
 puts "Watched points: #{e.reputation_for(:watched_points)}"
 puts "Views: #{e.reputation_for(:views)}"
 puts "Payment: #{e.reputation_for(:payment_reputation)}"
end

The result for a given episode is:
Popularity: -272.2
Watched points: 0.0
Views: 0.0
Payment: 0.0

How could that be? Where could I even start debugging it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions