Daniel Choi
2007-Feb-28 05:47 UTC
flex_image has a bug because of class variables/inheritance
FlexImage has a serious bug at the moment because, internally, it stores the file_store value of its file-stored subclasses in a class variable @@file_store This is what happens as a result: Say I have two Rails model classes, A and B, that I make subclasses of FlexImage. If I set the self.file_store of each class to two different directories. FlexImage will set the SAME file_store directory for both A and B because of the way Ruby currently treats class variables of inherited classes as shared across all of them. I didn''t know how to contact the author of FlexImage so I thought I''d post this here. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Alex Wayne
2007-Apr-12 19:44 UTC
Re: flex_image has a bug because of class variables/inherita
Daniel Choi wrote:> FlexImage has a serious bug at the moment because, internally, it stores > the file_store value of its file-stored subclasses in a class variable > @@file_store > > This is what happens as a result: > > Say I have two Rails model classes, A and B, that I make subclasses of > FlexImage. If I set the self.file_store of each class to two different > directories. FlexImage will set the SAME file_store directory for both A > and B because of the way Ruby currently treats class variables of > inherited classes as shared across all of them. > > I didn''t know how to contact the author of FlexImage so I thought I''d > post this here.Multi Class Bug Fixed! http://beautifulpixel.com/articles/2007/04/12/fleximage_now_mulit_class_safe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---