Forum: Ruby on Rails Finding out the file attributes in FileColumn models

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Douglas T. (Guest)
on 2006-05-15 13:57
(Received via mailing list)
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.
Douglas T. (Guest)
on 2006-05-16 12:55
(Received via mailing list)
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.
Heikki Y. (Guest)
on 2006-05-16 22:51
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?
Douglas T. (Guest)
on 2006-05-17 07:13
(Received via mailing list)
I'll be posting an entry on my blog about this soon, so stay tuned?
Douglas T. (Guest)
on 2006-05-17 08:01
(Received via mailing list)
here's how I got automatic file creation for fixtures to work
http://www.practicalguile.com/articles/ruby/rails/...
Heikki Y. (Guest)
on 2006-05-17 08:19
Great! I'll be testing this today. Thanks a lot!
This topic is locked and can not be replied to.