Class Attachment
In: app/models/attachment.rb
Parent: ActiveRecord::Base

添付ファイルのモデル

Methods

copy  

Constants

LABEL_FILE_TYPE = [ [N_("Attachment|file_type|Database"), "BinaryObject"], [N_("Attachment|file_type|Server"), "StorageObject"], ]

Public Instance methods

複写機能のためのコピーを返す。失敗した場合は false を返す。

[Source]

    # File app/models/attachment.rb, line 43
43:   def copy
44:     copied = self.class.new
45:     copied.attributes = attributes
46:     if copied.file = file.copy
47:       copied.attachable_id = nil
48:       return copied
49:     end
50:     return false
51:   end

[Validate]