aboutsummaryrefslogtreecommitdiff
path: root/lib/dm-sqlite-adapter-with-mutex.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-05-01 14:03:52 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-05-01 14:03:52 +0100
commite55096b063720e0be4ca8d774095d2f6dfb7c086 (patch)
tree1b3b7c743bf1963bfe7cf11270ad719072a19200 /lib/dm-sqlite-adapter-with-mutex.rb
parentbb5ac2581ce9aa6a1a03c97986e91ad89f67fe3f (diff)
parentfafac666b1d9f1b73fe4330af6b3c14d57ded2cb (diff)
merge
Diffstat (limited to 'lib/dm-sqlite-adapter-with-mutex.rb')
-rw-r--r--lib/dm-sqlite-adapter-with-mutex.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/dm-sqlite-adapter-with-mutex.rb b/lib/dm-sqlite-adapter-with-mutex.rb
index 2842c5e..6c5c022 100644
--- a/lib/dm-sqlite-adapter-with-mutex.rb
+++ b/lib/dm-sqlite-adapter-with-mutex.rb
@@ -5,20 +5,11 @@
require 'dm-sqlite-adapter'
require 'monitor'
-ADAPTER = DataMapper::Adapters::SqliteAdapter
+class DataMapper::Adapters::SqliteAdapter
-# better way to alias a private method? (other than "don't"? :) )
-ADAPTER.__send__(:alias_method, :initialize_old, :initialize)
-ADAPTER.__send__(:undef_method, :initialize)
-ADAPTER.__send__(:alias_method, :with_connection_old, :with_connection)
-ADAPTER.__send__(:undef_method, :with_connection)
+ include MonitorMixin
-class ADAPTER
-
- def initialize(*a)
- extend(MonitorMixin)
- initialize_old(*a)
- end
+ alias_method :with_connection_old, :with_connection
private