Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/payout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Payout < ApplicationRecord
scope :escrowed, -> { where(escrowed: true) }
scope :released, -> { where(escrowed: false) }

VOTE_COUNT_REQUIRED = 14
VOTE_COUNT_REQUIRED = 10

# x = ELO percentile (0-1)
def self.calculate_multiplier(x)
Expand Down
6 changes: 3 additions & 3 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -543,17 +543,17 @@ def issue_payouts
ship_event_vote_count = VoteChange.where(project: self).where("created_at > ?", ship.created_at).count

# Only process ship events that have exactly 18 votes
next unless ship_event_vote_count == 14
next unless ship_event_vote_count == 10

# Calculate cumulative vote count for this ship event payout
votes_before_ship = VoteChange.where(project: self).where("created_at <= ?", ship.created_at).count
cumulative_vote_count_at_payout = votes_before_ship + 14
cumulative_vote_count_at_payout = votes_before_ship + 10

puts "Ship #{ship.id} created at #{ship.created_at}: votes_before=#{votes_before_ship}, cumulative=#{cumulative_vote_count_at_payout}"

# Find when this ship event got its 18th vote
# This is when votes_before_ship + votes after ship creation = cumulative_vote_count_at_payout
ship_votes_needed = 14
ship_votes_needed = 10
target_vote_count = votes_before_ship + ship_votes_needed

# Get the project's ELO rating when it reached this target vote count
Expand Down
4 changes: 2 additions & 2 deletions app/services/user_vote_queue_matchup_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def build!

@unpaid_projects = @projects_with_time.select { |p| !p[:is_paid] }
@paid_projects = @projects_with_time.select { |p| p[:is_paid] }
@mature_unpaid_projects = @projects_with_time.select { |p| p[:votes_count].to_i >= 12 && !p[:is_paid] }
@immature_unpaid_projects = @projects_with_time.select { |p| p[:votes_count].to_i < 12 && !p[:is_paid] }
@mature_unpaid_projects = @projects_with_time.select { |p| p[:votes_count].to_i >= 10 && !p[:is_paid] }
@immature_unpaid_projects = @projects_with_time.select { |p| p[:votes_count].to_i < 5 && !p[:is_paid] }
self
end

Expand Down