Sha256: 793d67f16031888e3c593cbf9025064df430babc51a330d81a5f4c80fe7dd5d2

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

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
      # The default identify is :id instead of :to_param so that the identify
      # can be used as the default resource key
      Merb::Router.root_behavior = Merb::Router.root_behavior.identify(ActiveRecord::Base => :id)
    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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb_activerecord-0.9.10 lib/merb_activerecord.rb
merb_activerecord-0.9.11 lib/merb_activerecord.rb
merb_activerecord-0.9.12 lib/merb_activerecord.rb
merb_activerecord-0.9.13 lib/merb_activerecord.rb
merb_activerecord-0.9.8 lib/merb_activerecord.rb
merb_activerecord-0.9.9 lib/merb_activerecord.rb