From 92d61ebb88dda29d1168be3d3436761869c97439 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 24 Apr 2013 19:32:10 +0300 Subject: Remove useless aliases --- lib/oxidized/source/sql.rb | 3 +-- lib/tst | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.1