summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/environment.rb2
-rw-r--r--lib/opentox-ruby.rb2
-rw-r--r--lib/overwrite.rb6
3 files changed, 9 insertions, 1 deletions
diff --git a/lib/environment.rb b/lib/environment.rb
index 5b16e4a..73df64e 100644
--- a/lib/environment.rb
+++ b/lib/environment.rb
@@ -52,6 +52,8 @@ if CONFIG[:database]
#DataMapper.setup(:default, {:adapter => "redis"})
#DataMapper::Model.raise_on_save_failure = true
+ require 'ohm'
+ Ohm.connect :thread_safe => true
end
# load mail settings for error messages
diff --git a/lib/opentox-ruby.rb b/lib/opentox-ruby.rb
index 735b845..ab8d824 100644
--- a/lib/opentox-ruby.rb
+++ b/lib/opentox-ruby.rb
@@ -1,4 +1,4 @@
-['rubygems', 'sinatra', 'sinatra/url_for', 'rest_client', 'yaml', 'cgi', 'spork', 'error', 'overwrite', 'environment'].each do |lib|
+['rubygems', 'sinatra', 'sinatra/url_for', 'ohm', 'rest_client', 'yaml', 'cgi', 'spork', 'error', 'overwrite', 'environment'].each do |lib|
require lib
end
diff --git a/lib/overwrite.rb b/lib/overwrite.rb
index b5c3942..fbe775d 100644
--- a/lib/overwrite.rb
+++ b/lib/overwrite.rb
@@ -137,3 +137,9 @@ class OTLogger < Logger
end
+# make migration from datamapper more straightforward
+class Ohm::Model
+ def self.get(id)
+ self[id]
+ end
+end