Class: Cardboard::Field::File

Inherits:
Cardboard::Field show all
Defined in:
app/models/cardboard/field/file.rb

Instance Attribute Summary

Attributes inherited from Cardboard::Field

#default, #seeding

Instance Method Summary collapse

Methods inherited from Cardboard::Field

new_with_castnew, #required?, #type, #type=

Instance Method Details

#valueObject



9
10
11
12
13
14
15
16
# File 'app/models/cardboard/field/file.rb', line 9

def value
  return nil unless value_uid
  if value_uid =~ /^app\/assets\/files/
    Dragonfly.app.fetch_file(value_uid)
  else
    Dragonfly.app.fetch(value_uid)
  end
end