# Odd file\_column behaviour

**URL:** <https://www.ruby-forum.com/t/odd-file-column-behaviour/90868>\
**Category:** Rails\
**Created:** [April 2, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/odd-file-column-behaviour/90868 "2007-04-02T16:06:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SiSiSi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@SiSiSi](https://www.ruby-forum.com/u/SiSiSi)\
**Post date:** [April 2, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/odd-file-column-behaviour/90868/1 "2007-04-02T16:06:01Z")

</div>

I’ve been having an odd problem all morning… Have used the great  
file\_column plugin many times before without problems, however on one  
app I’mworking on right now it’s refusing to work properly.

When I go to create a new record via the backend system I’ve written I  
get the exception:

“Trying to access file\_column, but primary key got lost.”

However if I go to edit an existing record everything works perfectly  
and I can upload files.

This is only the second app I’ve written on my PowerBook using  
Locomotive and (lazily) sqlite, I’ve usually written stuff on a FreeBSD  
server with Postgres so perhaps its a platform/DB issue? Any ideas, I’m  
stumped…

Si.

---

<div class="post-metadata">

**Author:** ![SiSiSi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@SiSiSi](https://www.ruby-forum.com/u/SiSiSi)\
**Post date:** [April 2, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/odd-file-column-behaviour/90868/2 "2007-04-02T17:03:53Z")

</div>

For the record this is a platform/DB problem, installed MySQL 5 and have  
no problems.

Si.

Si wrote:

> I’ve been having an odd problem all morning… Have used the great  
> file\_column plugin many times before without problems, however on one  
> app I’mworking on right now it’s refusing to work properly.
> 
> When I go to create a new record via the backend system I’ve written I  
> get the exception:
> 
> “Trying to access file\_column, but primary key got lost.”
> 
> However if I go to edit an existing record everything works perfectly  
> and I can upload files.
> 
> This is only the second app I’ve written on my PowerBook using  
> Locomotive and (lazily) sqlite, I’ve usually written stuff on a FreeBSD  
> server with Postgres so perhaps its a platform/DB issue? Any ideas, I’m  
> stumped…
> 
> Si.
