asdf
Diff
code posted
by
asdf
created at 24 Jul 22:52
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
diff --git a/models/cdr_record.rb b/models/cdr_record.rb index 79ccdbc..0762baa 100644 --- a/models/cdr_record.rb +++ b/models/cdr_record.rb @@ -1,7 +1,7 @@ BASE_DIR = "#{File.expand_path(File.dirname(__FILE__))}/.." require 'mongoid' require 'digest' -require 'csv' + require "#{BASE_DIR}/lib/signaling_address" class CdrRecord @@ -78,7 +78,9 @@ private index.each do |sub_index| unless @record_array[sub_index].empty? return SignalingAddress.new(hex: extract_point_code(@record_array[sub_index])) if @record_array[sub_index] =~ /0x/ - return SignalingAddress.new(address: @record_array[sub_index]) if @record_array[sub_index] =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ + return @record_array[sub_index] if @record_array[sub_index] =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ + else + return 0 end end end |
894 Bytes in 6 ms with coderay