lib/conceptql/nodes/define.rb in conceptql-0.0.6 vs lib/conceptql/nodes/define.rb in conceptql-0.0.7

- old
+ new

@@ -13,11 +13,10 @@ # and then insert that variable into the concept as needed. # run the query once and subsequent calls class Define < Node def initialize(*args) super - tree.defined[table_name] = self end # Create a temporary table and store the stream of results in that table. # This "caches" the results so we only have to execute stream's query # once. # @@ -51,9 +50,14 @@ stream.types end def sql(db) db[db.send(:create_table_as_sql, table_name, stream.evaluate(db).sql, temp: true)].sql + end + + def tree=(tree) + super + tree.defined[table_name] = self end private def table_name