Finding out the file attributes in FileColumn models

Is there a way to find out the attributes that have been passed to
file_column in models? I’ve looked through the source and it seems that
the
file_column methods are generated at runtime but there’s actually no
class
or instance variable that hold the file attribute.

consider this itch scratched, spent 1.5 days trying to understand the
Fixtures and the FileColumn module. Got it to work by extending the
FileColumn module with a class variable that stores the attribute value
passed to file_column.

I wanted to have a way to know the file attribute as I needed a way to
automatically create files for the fixtures which are for models with
file_column attributes. Once I figured out how to retrieve the file
attributes for each model, this became trivial to implement.

I’ll be posting an entry on my blog about this soon, so stay tuned?

Douglas T. wrote:

I wanted to have a way to know the file attribute as I needed a way to
automatically create files for the fixtures which are for models with
file_column attributes. Once I figured out how to retrieve the file
attributes for each model, this became trivial to implement.

I run into same problem today when I was writing tests for model which
uses file_column. Any change for sharing how you did the fixture file
creation?

Great! I’ll be testing this today. Thanks a lot!

here’s how I got automatic file creation for fixtures to work
http://www.practicalguile.com/articles/ruby/rails/automatically-creating-files-for-file_column-models-in-fixtures/