Sha256: d2da8ccf2343fea34bb78f8e057f761abfcfa3c0f9f46984871c2ecbb91d35bf
Contents?: true
Size: 796 Bytes
Versions: 13
Compression:
Stored size: 796 Bytes
Contents
class DownloadsDataset < Dataset::Base uses :download_sites if defined? Site def load create_download "grouped" create_download "alsogrouped" create_download "ungrouped" end helpers do def create_download(name, attributes={}) attributes[:site] ||= sites(:test) if defined? Site create_model :download, name.symbolize, download_attributes(attributes.update(:name => name)) end def download_attributes(att={}) name = att[:name] || "A download" attributes = { :name => name, :description => "Test download" }.merge(att) attributes[:site_id] ||= site_id(:test) if defined? Site attributes[:document] ||= File.new(File.dirname(__FILE__) + "/../files/test.pdf") attributes end end end
Version data entries
13 entries across 13 versions & 3 rubygems