mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
11 lines
285 B
Ruby
11 lines
285 B
Ruby
class ResultAsset < ActiveRecord::Base
|
|
validates :result, :asset, presence: true
|
|
|
|
belongs_to :result, inverse_of: :result_asset
|
|
belongs_to :asset, inverse_of: :result_asset,
|
|
dependent: :destroy
|
|
|
|
def space_taken
|
|
asset.present? ? asset.estimated_size : 0
|
|
end
|
|
end
|