Displaying 1 result from an estimated 1 matches for "column_names_a".
Did you mean:
column_names_b
2006 May 08
0
ActiveRecord and refreshing column info
...want to find out what column names exist in two tables,
table_a and table_b.
One way I''ve been doing this is using ActiveRecord and the column info
it returns. After establishing a connection for ActiveRecord, I do the
following:
ActiveRecord::Base.set_table_name("table_a")
column_names_a = ActiveRecord::Base.column_names
ActiveRecord::Base.set_table_name("table_b")
column_names_b = ActiveRecord::Base.column_names
The problem I have is that once I set the table_name to ''table_a'',
ActiveRecord always returns table_a''s column info. I''ve...