engine/app/models/locomotive/editable_file.rb
Didier Lafforgue 0c65516807 fix issue #320
2012-03-08 02:32:59 +01:00

17 lines
344 B
Ruby

module Locomotive
class EditableFile < EditableElement
mount_uploader 'source', EditableFileUploader
replace_field 'source', ::String, true
def content
self.source? ? self.source.url : self.default_content
end
def as_json(options = {})
Locomotive::EditableFilePresenter.new(self).as_json
end
end
end