lib/ronin/model.rb in ronin-0.1.2 vs lib/ronin/model.rb in ronin-0.1.3
- old
+ new
@@ -1,11 +1,11 @@
#
#--
# Ronin - A Ruby platform designed for information security and data
# exploration tasks.
#
-# Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com)
+# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@@ -33,22 +33,24 @@
# Name of Ronin's DataMapper repository
REPOSITORY_NAME = :ronin
def self.included(base)
- base.module_eval do
- include DataMapper::Resource
- include DataMapper::AutoMigrations
+ unless base.ancestors.include?(DataMapper::Resource)
+ base.module_eval do
+ include DataMapper::Resource
+ include DataMapper::AutoMigrations
- #
- # Returns the default repository name for the model.
- #
- def self.default_repository_name
- Model::REPOSITORY_NAME
- end
+ #
+ # Returns the default repository name for the model.
+ #
+ def self.default_repository_name
+ Model::REPOSITORY_NAME
+ end
- # The class type property
- property :type, Discriminator
+ # The class type property
+ property :type, Discriminator
+ end
end
end
end
end