mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
10 lines
274 B
Ruby
10 lines
274 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ResultAsset < ApplicationRecord
|
|
belongs_to :result, inverse_of: :result_assets, touch: true
|
|
belongs_to :asset, inverse_of: :result_asset, dependent: :destroy
|
|
|
|
def space_taken
|
|
asset.present? ? asset.estimated_size : 0
|
|
end
|
|
end
|