# Inheritance problem on site5

**URL:** <https://www.ruby-forum.com/t/inheritance-problem-on-site5/175678>\
**Category:** Rails\
**Created:** [September 17, 2009, 3:10pm UTC](https://www.ruby-forum.com/t/inheritance-problem-on-site5/175678 "2009-09-17T15:10:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gatsby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@gatsby](https://www.ruby-forum.com/u/gatsby)\
**Post date:** [September 17, 2009, 3:10pm UTC](https://www.ruby-forum.com/t/inheritance-problem-on-site5/175678/1 "2009-09-17T15:10:19Z")

</div>

Hello,

I’ve uploaded my web application to site5 recently and I’ve encountered  
a  
big inheritance problem.

My application has an abstract model Media that is inherited by several  
other models (such as Post, Picture, Event). I’ve created this structure  
in  
order to use only one controller for the comments on these classes. As  
some  
of these classes allow users to upload a picture on amazon s3 using  
Paperclip, I’ve put the has\_attachment attribute inside my Media model,  
and  
the validates\_attachment\_presence attribute only on the models that  
really  
use it.

The problem I have is that, as opposed to when I used my personal  
computer  
as the Rails server, on site5 any of the classes inheriting Media and  
that  
do not have an attachment displays an error when I submit the create or  
edit  
form, to warn me that the attachment Image must be present.

Why do I have this error message, although I’m pretty confident that my  
configuration is correct ?

Thank you for your help, and excuse my English (if you didn’t understand  
a  
part of the above, don’t hesitate to ask precisions)

Cyril

---

<div class="post-metadata">

**Author:** ![gatsby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@gatsby](https://www.ruby-forum.com/u/gatsby)\
**Post date:** [September 17, 2009, 3:24pm UTC](https://www.ruby-forum.com/t/inheritance-problem-on-site5/175678/2 "2009-09-17T15:24:13Z")

</div>

With most dev-to-live problems, first we need to check what versions of  
Rails is used in both environment… Then try to run your application on  
your dev machine with the live version of Rails ?

---

<div class="post-metadata">

**Author:** ![gatsby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@gatsby](https://www.ruby-forum.com/u/gatsby)\
**Post date:** [September 19, 2009, 4:16am UTC](https://www.ruby-forum.com/t/inheritance-problem-on-site5/175678/3 "2009-09-19T04:16:34Z")

</div>

Did you try to change the environment in your computer from  
development to production and run the application that way? Maybe the  
problem is seeing only in production mode and you can reproduce it.
