Permalink
Browse files

Project reorganization

  • Loading branch information...
1 parent 1bdf334 commit 19bbecc5e8f5a247cf68a3edd58e9e117814ae87 @alindeman alindeman committed Sep 13, 2011
Showing with 5 additions and 17 deletions.
  1. +4 −13 lib/mm-optimistic_locking.rb
  2. +0 −2 mm-optimistic_locking.gemspec
  3. +1 −2 spec/spec_helper.rb
@@ -1,17 +1,8 @@
require 'mongo_mapper'
-module MongoMapper
- autoload :StaleDocumentError, "mongo_mapper/stale_document_error"
+require File.expand_path("mongo_mapper/stale_document_error", File.dirname(__FILE__))
+require File.expand_path("mongo_mapper/plugins/optimistic_locking", File.dirname(__FILE__))
- module Plugins
- autoload :OptimisticLocking, "mongo_mapper/plugins/optimistic_locking.rb"
- end
-
- module Plugins
- module Querying
- module InstanceMethods
- include MongoMapper::Plugins::OptimisticLocking::QueryingInterceptor
- end
- end
- end
+MongoMapper::Plugins::Querying::InstanceMethods.class_eval do
+ include MongoMapper::Plugins::OptimisticLocking::QueryingInterceptor
end
@@ -1,6 +1,4 @@
# -*- encoding: utf-8 -*-
-$:.push File.expand_path("../lib", __FILE__)
-require "mm-optimistic_locking"
Gem::Specification.new do |s|
s.name = "mm-optimistic_locking"
View
@@ -9,8 +9,7 @@
rescue LoadError
end
-$:.push(File.expand_path("../lib", File.dirname(__FILE__)))
-require 'mm-optimistic_locking'
+require File.expand_path("../lib/mm-optimistic_locking", File.dirname(__FILE__))
MongoMapper.connection = Mongo::Connection.new('localhost', 27017)
MongoMapper.database = "mm-optimistic_locking_test"

0 comments on commit 19bbecc

Please sign in to comment.