On 5 May 2011, at 18:51, Fearless Fool <li...@ruby-forum.com> wrote:
> Fearless Fool wrote in post #996869: >> So my next approach will be some magick with const_defined? -- this time >> for sure!!! ;) > > I tried that and now I'm really confused. @Fred: would you expect it to > be the case that: > > class MeteredService < ActiveRecord::Base ; end > class PGEBusiness < MeteredService ; end > > Object.const_defined?("PGEBusiness") => true > yet > MeteredService.descendants => [] > ? > > That is, the system still knows about the class PGEBusiness, but it > doesn't show up as a descendant of MeteredService? That is, in fact, > what I'm seeing. > Have you been mixing in calls to require with calls to require_dependency/letting rails load things automatically? That can make a giant mess of things where some classes are reloaded and others aren't, so for example PGEService could be a subclass of the previous request's MeteredService Fred > More to the point, how can I tell when I need to reload the subclasses? > (And if require_dependencies is the answer, how to I avoid the > superclass mismatch error that I'm seeing?) > > (Feh. Maybe I should just start running in production mode.) > > TIA. > > -- > 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@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.