To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / test / exemplars / attachment_exemplar.rb @ 441:cbce1fd3b1b7

History | View | Annotate | Download (404 Bytes)

1
class Attachment < ActiveRecord::Base
2
  generator_for :container, :method => :generate_project
3
  generator_for :file, :method => :generate_file
4
  generator_for :author, :method => :generate_author
5

    
6
  def self.generate_project
7
    Project.generate!
8
  end
9

    
10
  def self.generate_author
11
    User.generate_with_protected!
12
  end
13

    
14
  def self.generate_file
15
    @file = ActiveSupport::TestCase.mock_file
16
  end
17
end