Class: Cardboard::Field::Image
Instance Attribute Summary
#seeding
Instance Method Summary
collapse
new_with_castnew, #required?, #type, #type=
Instance Method Details
#default ⇒ Object
21
22
23
24
|
# File 'app/models/cardboard/field/image.rb', line 21
def default
Dragonfly.app.generate(:plain, [400, 800].sample, 600, :color => '#CCCCCC')
end
|
#value ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'app/models/cardboard/field/image.rb', line 12
def value
return nil unless value_uid
if value_uid =~ /^app\/assets\/images/
Dragonfly.app.fetch_file(value_uid)
else
Dragonfly.app.fetch(value_uid)
end
end
|