view test/exemplars/attachment_exemplar.rb @ 462:b02b2eb2a312 feature_36

Searching for publications via AJAX call; the publication ID is not being sent correctly, so still shows the current publication's associated projects in the select list.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 21 Jun 2011 01:27:41 +0100
parents 1d32c0a0efbf
children
line wrap: on
line source
class Attachment < ActiveRecord::Base
  generator_for :container, :method => :generate_project
  generator_for :file, :method => :generate_file
  generator_for :author, :method => :generate_author

  def self.generate_project
    Project.generate!
  end

  def self.generate_author
    User.generate_with_protected!
  end

  def self.generate_file
    @file = ActiveSupport::TestCase.mock_file
  end
end