Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Project reorganization

  • Loading branch information...
commit 19bbecc5e8f5a247cf68a3edd58e9e117814ae87 1 parent 1bdf334
@alindeman alindeman authored
View
17 lib/mm-optimistic_locking.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
View
2  mm-optimistic_locking.gemspec
@@ -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
3  spec/spec_helper.rb
@@ -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.
Something went wrong with that request. Please try again.