congress_scorecard.rb 437 B

123456789101112
  1. # The CongressScorecard creates a card for a member of congress for each
  2. # petition action that drew in a signature from one of their constituents
  3. # So calling #counter on a model will display the number of signatures from
  4. # that member's constituents
  5. class CongressScorecard < ActiveRecord::Base
  6. belongs_to :action_page
  7. def increment!
  8. CongressScorecard.increment_counter(:counter, id) # Increments counter atomically
  9. end
  10. end