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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 ? -- Posted via http://www.ruby-forum.com/.
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. On Sep 17, 9:08 am, Cyril Lavedrine <lavedrine.cy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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