Sha256: 2a7e07ee16ef7b1ab399264160e8cb75b23e8994dc4e525baecdfea5ffba47ad
Contents?: true
Size: 486 Bytes
Versions: 27
Compression:
Stored size: 486 Bytes
Contents
module Locomotive module Concerns module ContentEntry module FileSize extend ActiveSupport::Concern included do ## fields ## field :_file_size, type: Integer, default: 0 ## callbacks ## before_save :sync_file_size end private def sync_file_size self._file_size = self.file_custom_fields.inject(0) { |sum,field| send(field).size + sum } end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems