lib/og.rb in og-0.21.0 vs lib/og.rb in og-0.21.2
- old
+ new
@@ -66,23 +66,23 @@
#
# === Lifecycle Callbacks
#
# * og_read
# * og_insert
-# * og_update
-# * og_delete
+# * og_update
+# * og_delete
module Og
# The version.
- Version = '0.21.0'
+ Version = '0.21.2'
# Library path.
LibPath = File.dirname(__FILE__)
-
+
# If true, check for implicit changes in the object
# graph. For example when you add an object to a parent
# the object might be removed from his previous parent.
# In this case Og emmits a warning.
@@ -137,9 +137,29 @@
mattr_accessor :manager
# Pseudo type for binary data
class Blob; end
+
+ class << self
+
+ # Helper method, useful to initialize Og.
+
+ def setup(options = {})
+ m = @@manager = Manager.new(options)
+ m.manage_classes
+ return m
+ end
+ alias_method :connect, :setup
+ alias_method :options=, :setup
+
+ # Helper method.
+
+ def escape(str)
+ @@manager.store.escape(str)
+ end
+
+ end
end
# gmosx: leave this here.