summaryrefslogtreecommitdiff
path: root/lib/oxidized/source/sql.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2013-04-24 19:32:10 +0300
committerSaku Ytti <saku@ytti.fi>2013-04-24 19:32:10 +0300
commit92d61ebb88dda29d1168be3d3436761869c97439 (patch)
tree42c2036203197cefcf7b69d1ad6e8e4d2f16de91 /lib/oxidized/source/sql.rb
parent30f2826bbb49fa6d18ba5a8b98c69aeeb984eb30 (diff)
Remove useless aliases
Diffstat (limited to 'lib/oxidized/source/sql.rb')
-rw-r--r--lib/oxidized/source/sql.rb3
1 files changed, 1 insertions, 2 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