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 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/oxidized') 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 -- cgit v1.2.1