The code powering m.abunchtell.com https://m.abunchtell.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

26 satır
681 B

  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: status_stats
  5. #
  6. # id :bigint(8) not null, primary key
  7. # status_id :bigint(8) not null
  8. # replies_count :bigint(8) default(0), not null
  9. # reblogs_count :bigint(8) default(0), not null
  10. # favourites_count :bigint(8) default(0), not null
  11. # created_at :datetime not null
  12. # updated_at :datetime not null
  13. #
  14. class StatusStat < ApplicationRecord
  15. belongs_to :status, inverse_of: :status_stat
  16. after_commit :reset_parent_cache
  17. private
  18. def reset_parent_cache
  19. Rails.cache.delete("statuses/#{status_id}")
  20. end
  21. end