Module: ActiveStorage::Blob::Identifiable

Included in:
ActiveStorage::Blob
Defined in:
activestorage/app/models/active_storage/blob/identifiable.rb

Overview

Active Storage Blob Identifiable

Instance Method Summary collapse

Instance Method Details

#identified?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'activestorage/app/models/active_storage/blob/identifiable.rb', line 17

def identified?
  identified
end

#identifyObject



5
6
7
8
# File 'activestorage/app/models/active_storage/blob/identifiable.rb', line 5

def identify
  identify_without_saving
  save!
end

#identify_without_savingObject



10
11
12
13
14
15
# File 'activestorage/app/models/active_storage/blob/identifiable.rb', line 10

def identify_without_saving
  unless identified?
    self.content_type = identify_content_type
    self.identified = true
  end
end