engine/app/models/locomotive/editable_file.rb

17 lines
344 B
Ruby
Raw Normal View History

module Locomotive
class EditableFile < EditableElement
2012-03-08 01:32:59 +00:00
mount_uploader 'source', EditableFileUploader
2012-03-08 01:32:59 +00:00
replace_field 'source', ::String, true
2012-01-25 21:07:10 +00:00
def content
self.source? ? self.source.url : self.default_content
end
def as_json(options = {})
Locomotive::EditableFilePresenter.new(self).as_json
end
end
end