diff options
author | laf <neil@lathwood.co.uk> | 2017-11-10 14:44:45 +0000 |
---|---|---|
committer | laf <neil@lathwood.co.uk> | 2017-11-10 14:44:45 +0000 |
commit | d96cfac1f09ff4055f54ab604358290865d41f62 (patch) | |
tree | 2e306c714d2d3a963774b6d79ba767bdf14e8443 | |
parent | 29704b5f2721a742d312ced784a8076e27e8063b (diff) |
updated to check if node_want
-rw-r--r-- | lib/oxidized/source/sql.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/oxidized/source/sql.rb b/lib/oxidized/source/sql.rb index 7e2824d..97064fa 100644 --- a/lib/oxidized/source/sql.rb +++ b/lib/oxidized/source/sql.rb @@ -23,7 +23,11 @@ class SQL < Source db = connect query = db[@cfg.table.to_sym] query = query.with_sql(@cfg.query) if @cfg.query? - query = qeury.where(@cfg.map.name.to_sym node_want) + + if node_want + query = query.where(@cfg.map.name.to_sym=>node_want) + end + query.each do |node| # map node parameters keys = {} |