Class: CategoryPostType

Inherits:
ApplicationRecord show all
Defined in:
app/models/category_post_type.rb

Class Method Summary collapse

Methods inherited from ApplicationRecord

#attributes_print, fuzzy_search, match_search, #match_search, sanitize_for_search, sanitize_name, sanitize_sql_in, useful_err_msg, with_lax_group_rules

Class Method Details

.rep_changesObject



7
8
9
10
11
# File 'app/models/category_post_type.rb', line 7

def self.rep_changes
  Rails.cache.fetch 'network/category_post_types/rep_changes', include_community: false do
    all.to_h { |cpt| [[cpt.category_id, cpt.post_type_id], { 1 => cpt.upvote_rep, -1 => cpt.downvote_rep }] }
  end
end