Inheritance problem on site5

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

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 ?

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs