Updated

app/models/petition / statistics.rb

A
31 lines of codes
4 methods
4.0 complexity/method
2 churn
15.91 complexity
0 duplications
class Petition < ActiveRecord::Base class Statistics < ActiveRecord::Base
  1. Petition::Statistics has no descriptive comment
belongs_to :petition after_commit on: :create do UpdatePetitionStatisticsJob.perform_later(petition) end def refresh!(now = Time.current)
  1. Petition::Statistics has missing safe method 'refresh!'
update!( refreshed_at: now, duplicate_emails: refresh_duplicate_emails, pending_rate: refresh_pending_rate ) end def refreshed? refreshed_at? end private def refresh_duplicate_emails petition.signatures.duplicate_emails end def refresh_pending_rate petition.signatures.pending_rate end end end