Module: Knitkit::Extensions::ActiveRecord::ActsAsDocument::ClassMethods

Defined in:
lib/knitkit/extensions/active_record/acts_as_document.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_documentObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/knitkit/extensions/active_record/acts_as_document.rb', line 11

def acts_as_document
  extend ActsAsDocument::SingletonMethods
  include ActsAsDocument::InstanceMethods

  after_initialize :initialize_document
  					after_create :save_document
  					after_update :save_document
  					after_destroy :destroy_document

  has_one :document, :as => :document_record

  #from Document / FileAssets
  [:add_file, :files].each { |m| delegate m, :to => :document }
end