On Jun 26, 3:26 pm, Gary Yngve <[email protected]> wrote: > DataMapper creates a proxy ActiveSupport class. Unfortunately another > library may do a simple test defined?(ActiveSupport) to see if it > needs to do its own thing regarding defining blank, constantize, etc. > Any thoughts on how different libraries should behave with each other > regarding this? > > I suppose the most disciplined is to check one-by-one > String.respond_to(:blank?), String.respond_to(:constantize), etc. > > The problem is that facets, active_support, extlib, and merb-helper > all provide different sets of functionality and another library has to > decide which one to hitch on to (and active_support, as bulky as it > is, has been winning). For example, a_s and facets provide Array.sum, > and a_s and merb-helper provide Numeric.ago.
I can't attest for DataMapper, but fortunately as of Rails 3 the ActiveSupport folks have gotten things in much better shape. If you want to use additional support libraries simply load them first in config/preinitializer.rb. That way ActiveSupport will take precedence if there are any conflicts. For older versions of ActiveSupport (< v3) this could not be done b/c the code used mixins to add extensions -- which seems like a good idea, but in practice turns out to be a mess. ActiveSupport 3+ now extends the core classes directly. -- You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en.
