AR object sees columns in table twice?!?

AR 1.14.4
SQL Server 2000 (ODBC)

I have a model named Target that looks like this:

class Target < ActiveRecord::Base
set_table_name :FAXNET
set_primary_key :UniqueID


end

In ruby script/console, if I do
Target.column_names.each do |col|
puts col
end

I see a list of the column names, immediately followed by another list
of the column names - they’re duplicated!!! Assume columns A, B, C. I
see

A
B
C
A
B
C

If I run annotate_models against this object, my annotate_models shows
that there are two sets of columns!

This doesn’t happen with any of my other models, and I’ve verified
several times that the table looks correct.

Has anyone ever seen this?

Thanks,
Wes

Aha!

The table was defined in my database twice with two different owners.

The query to pull the column names doesn’t filter by owner (TABLE_SCHEMA
column in the INFORMATION_SCHEMA.COLUMNS pseudo-table).

Wes

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs