Sha256: fadb77ae45b8d03bcb663fb1a94d5cdb9c643e81e69ef9646074efed25a89df4
Contents?: true
Size: 459 Bytes
Versions: 5
Compression:
Stored size: 459 Bytes
Contents
module Elabs class ProjectsTag < ApplicationRecord self.table_name = 'projects_tags' belongs_to :project belongs_to :tag after_create :increment_counter_cache after_destroy :decrement_counter_cache private def increment_counter_cache tag.increment! :projects_count if project.publicly_visible? end def decrement_counter_cache tag.decrement! :projects_count if project.publicly_visible? end end end
Version data entries
5 entries across 5 versions & 1 rubygems