Module: Attach::ModelExtension
- Defined in:
- lib/attach/model_extension.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/attach/model_extension.rb', line 8 def self.included(base) base.extend ClassMethods base.after_save do if @pending_attachment_deletions self..where(:role => @pending_attachment_deletions).destroy_all end if @pending_attachments @pending_attachments.values.each(&:save!) @pending_attachments = nil end end end |