Sha256: a800c4e56e6b7f69fd5526ca6bf0e56ebcd63590ee79e9db3708ca04a58c9682
Contents?: true
Size: 601 Bytes
Versions: 10
Compression:
Stored size: 601 Bytes
Contents
module Bankserv class Request < ActiveRecord::Base serialize :data self.inheritance_column = :_type_disabled after_create :delegate! def self.process! self.where(:processed => false).each{|request| request.process!} end def delegate! case type when 'ahv' AccountHolderVerification.build! data.merge(bankserv_request_id: self.id) when 'debit' Debit.build! data.merge(bankserv_request_id: self.id) when 'credit' Credit.build! data.merge(bankserv_request_id: self.id) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems