I've got some problems right now using the new model for relationships
in fixtures (by label, not by id) and STI. What I've got, is a couple
Version has_one file_download with file_download_id on the versions
In my fixtures, I have two FileDownloads in my attachments.yml like
now, in my versions.yml, I have:
name: Alpha 1
description: this is the first alpha release for hemingway!
created_at: <%= (Time.now - 5.days).to_formatted_s(:db) %>
The problem I'm having is that it's trying to put file_download into a
column in versions when I run rake test:units
ActiveRecord::StatementInvalid: Mysql::Error: #42S22Unknown column
'file_download' in 'field list': INSERT INTO `versions`
(`file_download`, `name`, `project_id`, `updated_at`, `id`,
`revision`, `description`, `created_at`) VALUES
('hemingway_alpha_zip', 'Alpha 1', 2980859, '2007-11-14 11:23:26',
296151536, 2, 'this is the first alpha release for hemingway!',
Now, I've got two questions:
a) How can I make it think that file_download is a relationship and
not a field?
b) How can I get that label-hash id manually? (i.e. alpha -->
296151536) in case I just need to hack it in manually?