lib/exegesis/document.rb in mattly-exegesis-0.2.5 vs lib/exegesis/document.rb in mattly-exegesis-0.2.6

- old
+ new

@@ -17,12 +17,12 @@ def timestamps! define_method :set_timestamps do @attributes['updated_at'] = Time.now @attributes['created_at'] ||= Time.now end - expose 'updated_at', :as => Time, :writer => false - expose 'created_at', :as => Time, :writer => false + expose 'updated_at', :as => Time + expose 'created_at', :as => Time end def unique_id meth=nil, &block if block @unique_id_method = block @@ -82,9 +82,13 @@ save end def attachments @attachments ||= Exegesis::Document::Attachments.new(self) + end + + def _attachments= val + @attributes['_attachments'] = val end def to_json @attributes.merge({'_attachments' => @attachments}).to_json end \ No newline at end of file