Maybe the mistake was to introduce the symbolic name for each type. If you just use the class name, the normal dependency loading kicks in.
? Tom On 10 Sep 2009, at 21:15, kevinpfromnm wrote: > > I would say either of the first two. The last might be problematic or > confusing for people who use namespaced models. > > On Sep 10, 12:36 pm, Matt Jones <[email protected]> wrote: >> The discussion about loading rich types reminded me that I'd wanted >> to >> get some kind of autoloading working for a while - after all, nearly >> everything *else* in Rails handles loading behind the scenes. >> >> With some naming conventions, it should be possible to do autoloading >> on rich types - but the convention needs to be established. In >> particular, where should the files live? I've been using RAILS_ROOT/ >> lib/types for my rich types, loaded via an initializer, but that's >> not >> necessarily the right way. Here's some ideas: >> >> - in most cases, it seems logical to keep the filename matching the >> underscored type name; this fits with Rails conventions. So a field >> declared as 'phone :phone_number' would look for phone_number.rb >> someplace. Possiblities: >> >> - put types in lib/types >> - put types in app/rich_types >> - put types in app/models/rich_types >> >> or maybe another place? I think its important to get this working >> before 1.0, as type loading has historically been a weak point. >> >> --Matt Jones > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hobousers?hl=en -~----------~----~----~----~------~----~------~--~---
