Module: Versions::Attachment::Owner
- Defined in:
- lib/versions/attachment.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/versions/attachment.rb', line 56 def self.included(base) base.class_eval do before_create :save_attachment before_update :attachment_before_update before_destroy :attachment_before_destroy end end |
Instance Method Details
#file ⇒ Object
74 75 76 |
# File 'lib/versions/attachment.rb', line 74 def file @file ||= ? .file : nil end |
#file=(file) ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/versions/attachment.rb', line 64 def file=(file) if @attachment_to_unlink = self. self. = nil end @attachment_need_save = true @file = file self.(:file => file) end |
#filepath ⇒ Object
78 79 80 |
# File 'lib/versions/attachment.rb', line 78 def filepath ? .filepath : nil end |