engine/app/models/locomotive/editable_file.rb
2012-01-25 22:07:10 +01:00

17 lines
382 B
Ruby

module Locomotive
class EditableFile < EditableElement
mount_uploader :source, EditableFileUploader, :mount_on => :source_filename
replace_field :source_filename, ::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