if defined?(Merb::Plugins)  
  
  dependency "activerecord"
  
  require File.join(File.dirname(__FILE__) / "merb" / "orms" / "active_record" / "connection")
  Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__) / "active_record" / "merbtasks"))
  
  class Merb::Orms::ActiveRecord::Connect < Merb::BootLoader

    after BeforeAppLoads

    def self.run
      Merb::Orms::ActiveRecord.connect
      if Merb::Config.session_stores.include?(:activerecord)
        Merb.logger.debug "Using ActiveRecord sessions"
        require File.join(File.dirname(__FILE__) / "merb" / "session" / "active_record_session")
      end
    end

  end
  
  generators = File.join(File.dirname(__FILE__), 'generators')
  Merb.add_generators generators / :migration
  Merb.add_generators generators / :model
  Merb.add_generators generators / :resource_controller
  Merb.add_generators generators / :session_migration

end
if defined?(Merb::Plugins)  
  
  dependency "activerecord"
  
  require File.join(File.dirname(__FILE__) / "merb" / "orms" / "active_record" / "connection")
  Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__) / "active_record" / "merbtasks"))
  
  class Merb::Orms::ActiveRecord::Connect < Merb::BootLoader

    after BeforeAppLoads

    def self.run
      Merb::Orms::ActiveRecord.connect
      if Merb::Config.session_stores.include?(:activerecord)
        Merb.logger.debug "Using ActiveRecord sessions"
        require File.join(File.dirname(__FILE__) / "merb" / "session" / "active_record_session")
      end
      Merb::Router.root_behavior = Merb::Router.root_behavior.identify(ActiveRecord::Base => :to_param)
    end

  end
  
  generators = File.join(File.dirname(__FILE__), 'generators')
  Merb.add_generators generators / :migration
  Merb.add_generators generators / :model
  Merb.add_generators generators / :resource_controller
  Merb.add_generators generators / :session_migration

end
Update to integrate Merb's new router
Update to integrate Merb's new router

Updated merb_activerecord to set a default identify for the router.
See the changes to the router for more information on the #identify
method.
