lib/bankserv/transmission/input_document.rb in bankserv-0.5.2 vs lib/bankserv/transmission/input_document.rb in bankserv-0.5.3
- old
+ new
@@ -1,9 +1,20 @@
class Bankserv::InputDocument < Bankserv::Document
def self.document_type
'input'
end
+
+ def mark_processed!
+ mark_records_pending!
+ self.update_attributes!(processed: true)
+ end
+
+ def mark_records_pending!
+ records.each do |rec|
+ rec.pending! if rec.respond_to?(:pending!)
+ end
+ end
def self.store(string)
options = Absa::H2h::Transmission::Document.hash_from_s(string, 'input')
raise "Expected a document set" unless options[:type] == "document"
\ No newline at end of file