lib/couchrest/model/extended_attachments.rb
# Add a file attachment to the current document. Expects
# :file and :name to be included in the arguments.
Add a file attachment to the current document. Expects
:file and :name to be included in the arguments.
Add a file attachment to the current document . Expects : file and : name to be included in the arguments .
def create_attachment(args={})
        raise ArgumentError unless args[:file] && args[:name]
        return if has_attachment?(args[:name])
        set_attachment_attr(args)
      rescue ArgumentError => e
        raise ArgumentError, 'You must specify :file and :name'
      end
def create_attachment ( args = { } ) raise ArgumentError unless args [ :file ] && args [ :name ] return if has_attachment? ( args [ :name ] ) set_attachment_attr ( args ) rescue ArgumentError => e raise ArgumentError , 'You must specify :file and :name' end
Add a file attachment to the current document.
Add a file attachment to the current document .
args