Automatically mapping content_columns?


#1

Hi all,

Quick setup - I’ve got a table Foo. Foo has a foreign key (bar_id) to
the
table Bar. The Bar table has an “id” and “name” column. Assume a 1:1
relationship.

The issue I’m trying to resolve (or rather, be lazy about) is with
regards to
Foo.content_columns. By default it doesn’t pickup the foreign key. What
I’m
wondering is if there’s a convenient way to have content_columns
automatically
pick up both the column name and value that I’m after in the parent
table. Or
is that just something I have to work out manually in the view or
controller,
or by redefining content_columns?

I don’t want to just use Foo.columns, because that will give two values
I don’t
want - the “bar_id” column name and the corresponding integer, neither
of which
I want displayed in a view.

If this is all covered by the content_columns documentation somewhere,
just
point me to it (I didn’t see anything in the Agile book).

Regards,

Dan