Module: UploadBehavior::ClassMethods

Defined in:
app/models/upload.rb

Instance Method Summary collapse

Instance Method Details

#comma_spliced_single_quoted(array) ⇒ Object



22
23
24
# File 'app/models/upload.rb', line 22

def comma_spliced_single_quoted array
  array.collect{|type| "'#{type}'"}.join(',')
end

#file_name_exists?(name) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/models/upload.rb', line 25

def file_name_exists? name
  !where("local_file_name = ? OR remote_file_name = ?", name, name).count.zero?
end