Module: Notebook::ActiveRecordAttachment::ClassMethods
- Defined in:
- lib/notebook/rails/active_record.rb
Instance Method Summary collapse
-
#notebook_attachment(name) ⇒ Object
Attachment method which hooks into ActiveRecord models.
Instance Method Details
#notebook_attachment(name) ⇒ Object
Attachment method which hooks into ActiveRecord models
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/notebook/rails/active_record.rb', line 9 def (name) define_method "#{name}" do end define_method "#{name}=" do |value| = Notebook::Attachment.new(value) .upload end after_destroy do .delete end end |