summaryrefslogtreecommitdiffstats
path: root/test/exemplars/attachment_exemplar.rb
blob: 8100fe906ffc434a6352e57f3aa496d6b1a584b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 = mock_file
  end
end