Sha256: 7587bcebbf1361020fe8d11774609ee406c289e7db9978aa1b26356c9f54979e
Contents?: true
Size: 870 Bytes
Versions: 31
Compression:
Stored size: 870 Bytes
Contents
module Bankserv class Document < ActiveRecord::Base self.inheritance_column = :_type_disabled belongs_to :set has_many :sets serialize :error def mark_processed! self.update_attributes!(processed: true) end def to_hash set.to_hash end def input? type == 'input' end def output? type == 'output' end def reply? type == 'reply' end def sets set.contained_sets end def records # unordered flat array records sets.map(&:records).flatten end def set_with_generation_number(generation_number) sets.select{|set| set.generation_number == generation_number}.first end def set_with_dept_code(dept_code) sets.select{|set| set.header.data[:dept_code] == dept_code}.first end end end
Version data entries
31 entries across 31 versions & 1 rubygems