Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented adapter and namespace inheritance in Model

  • Loading branch information...
commit 90a861d07f6b528a3c3e18f554c6e94e2d8b1f67 1 parent 8fa2c93
Alex Serebryakov serebryakov authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/lib/model/base.rb
6 lib/lib/model/base.rb
View
@@ -138,6 +138,8 @@ def name
##
def adapter(name = nil, options = {})
return @adapter if name.nil?
+ @adapter_name = name
+ @adapter_opts = options
@adapter = RDFMapper::Adapters.register(name, self, options)
end
@@ -395,6 +397,10 @@ def find_from_ids(ids, options) #nodoc
def inherited(subclass) #nodoc
@@subclasses ||= []
@@subclasses << subclass
+ unless self == RDFMapper::Model
+ subclass.namespace(@namespace, :name => @ns)
+ subclass.adapter(@adapter_name, @adapter_opts)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.