summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/oxidized/source/sql.rb3
-rwxr-xr-xlib/tst2
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/oxidized/source/sql.rb b/lib/oxidized/source/sql.rb
index f7e6510..44f3f00 100644
--- a/lib/oxidized/source/sql.rb
+++ b/lib/oxidized/source/sql.rb
@@ -32,10 +32,9 @@ class SQL < Source
klass = Class.new(Sequel::Model @cfg[:table].to_sym)
SQL.send :remove_const, :Nodes if SQL.const_defined? :Nodes
SQL.const_set :Nodes, klass
- @cfg[:map].each { |new,old| Nodes.class_eval "alias #{new.to_sym} #{old.to_sym}" }
Nodes.each do |node|
keys = {}
- @cfg[:map].each { |key, _| keys[key] = node.send(key.to_sym) }
+ @cfg[:map].each { |key, sql_column| keys[key] = node.send(sql_column.to_sym) }
keys[:model] = map_model keys[:model] if keys.key? :model
nodes << keys
end
diff --git a/lib/tst b/lib/tst
index 6b314cc..5e9131f 100755
--- a/lib/tst
+++ b/lib/tst
@@ -10,10 +10,10 @@ rescue Exception => e
open Oxidized::Config::Crash, 'w' do |file|
file.puts '-' * 50
file.puts Time.now.utc
+ file.puts e.message
file.puts '-' * 50
file.puts e.backtrace
file.puts '-' * 50
- file.puts caller
end
raise
end