lib/og/adapters/psql.rb in nitro-0.11.0 vs lib/og/adapters/psql.rb in nitro-0.12.0

- old
+ new

@@ -1,8 +1,8 @@ # * George Moschovitis <gm@navel.gr> # (c) 2004-2005 Navel, all rights reserved. -# $Id: psql.rb 266 2005-02-28 14:50:48Z gmosx $ +# $Id: psql.rb 270 2005-03-07 17:52:16Z gmosx $ require 'postgres' require 'og/adapter' require 'og/connection' @@ -135,14 +135,14 @@ # 'many_to_many' relations. if klass.__meta and joins = klass.__meta[:sql_join] for data in joins # the class to join to and some options. - join_class, options = *data + join_name, join_class, options = *data # gmosx: dont use DBTABLE here, perhaps the join class # is not managed yet. - join_table = "#{self.class.join_table(klass, join_class)}" + join_table = "#{self.class.join_table(klass, join_class, join_name)}" join_src = "#{self.class.encode(klass)}_oid" join_dst = "#{self.class.encode(join_class)}_oid" begin conn.store.exec("CREATE TABLE #{join_table} ( key1 integer NOT NULL, key2 integer NOT NULL )").clear conn.store.exec("CREATE INDEX #{join_table}_key1_idx ON #{join_table} (key1)").clear