lib/og.rb in og-0.10.0 vs lib/og.rb in og-0.11.0

- old
+ new

@@ -1,8 +1,8 @@ # * George Moschovitis <gm@navel.gr> # (c) 2004-2005 Navel, all rights reserved. -# $Id: og.rb 259 2005-02-15 08:54:54Z gmosx $ +# $Id: og.rb 266 2005-02-28 14:50:48Z gmosx $ require 'glue' require 'glue/logger' require 'glue/attribute' require 'glue/property' @@ -87,57 +87,65 @@ # * Support stored procedures (pgsql) # * Support caching. # * Deserialize to OpenStruct. # * Better documentation. -class Og +module Og # The name. Name = 'ObjectGraph' # The version. - Version = '0.10.0' + Version = '0.11.0' # Library path. LibPath = File.dirname(__FILE__) # If true, only allow reading from the database. Usefull # for maintainance. - cattr_accessor :read_only_mode, false + mattr_accessor :read_only_mode, false # If true, the library automatically 'enchants' managed classes. # In enchant mode, special db aware methods are added to # managed classes and instances. + # If false, Og enchants only classes that define properties. - cattr_accessor :enchant_managed_classes, true + mattr_accessor :enchant_managed_classes, true # If true, use Ruby's advanced introspection capabilities to # automatically manage classes tha define properties. - cattr_accessor :auto_manage_classes, true + mattr_accessor :auto_manage_classes, true # If true, automatically include the Og meta-language into Module. - # - # By default this is FALSE, to avoid polution of the Module object. - # However if you include a prop_accessor or a managed Mixin in your + # If false, the polution of the Module object is avoided. However + # if you include a prop_accessor or a managed Mixin in your # object MetaLanguage gets automatically extended in the class. - cattr_accessor :include_meta_language, true + mattr_accessor :include_meta_language, true # Attach the following prefix to all generated SQL table names. # Usefull on hosting scenarios where you have to run multiple # web applications/sites on a single database. - cattr_accessor :table_prefix, nil + mattr_accessor :table_prefix, nil + # If true, Og tries to create/update the schema in the + # data store. For production/live environments set this to false + # and only set to true when the object model is upadated. + # For debug/development environments this should stay true + # for convienience. + + mattr_accessor :create_schema, true + # The active database. Og allows you to access multiple # databases from a single application. - cattr_accessor :db + mattr_accessor :db # Set the active database. def self.use(db) @@db = db