Sha256: 1c793e10e37a8022361f7f47d3922cf35ae495ac835e7f2a9f9f3f4e8e301eb4
Contents?: true
Size: 462 Bytes
Versions: 5
Compression:
Stored size: 462 Bytes
Contents
module Elabs class AlbumsUpload < ApplicationRecord self.table_name = 'albums_uploads' belongs_to :album belongs_to :upload after_create :increment_counter_cache after_destroy :decrement_counter_cache private def increment_counter_cache album.increment! :uploads_count if upload.publicly_visible? end def decrement_counter_cache album.decrement! :uploads_count if upload.publicly_visible? end end end
Version data entries
5 entries across 5 versions & 1 rubygems