#join: ",".to_alias OPS!

This commit is contained in:
Denis Knauf 2012-01-16 12:52:01 +01:00
parent 40deac93bf
commit 27639e24b7

View file

@ -148,7 +148,7 @@ class SmqlToAR
when :belongs_to when :belongs_to
@_joins += build_join query, pretable, t, refl.primary_key_name, premodel.primary_key @_joins += build_join query, pretable, t, refl.primary_key_name, premodel.primary_key
when :has_and_belongs_to_many when :has_and_belongs_to_many
jointable = [','] + table jointable = [Column::Col.new(',')] + table
@_joins += build_join refl.options[:join_table], pretable, @table_alias[jointable], premodel.primary_key, refl.primary_key_name @_joins += build_join refl.options[:join_table], pretable, @table_alias[jointable], premodel.primary_key, refl.primary_key_name
@_joins += build_join query, jointable, t, refl.association_foreign_key, refl.association_primary_key @_joins += build_join query, jointable, t, refl.association_foreign_key, refl.association_primary_key
else raise BuilderError, "Unkown reflection macro: #{refl.macro.inspect}" else raise BuilderError, "Unkown reflection macro: #{refl.macro.inspect}"