Skip to content
Browse files

Tidy up inclusions/extensions.

  • Loading branch information...
1 parent e77bff3 commit d85cf00044970170e29188ffa8075f318dcac3e1 @elliotcm elliotcm committed
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/document.rb
  2. +1 −1 lib/document/persistence.rb
  3. +1 −1 spec/document/serialization_spec.rb
View
8 lib/document.rb
@@ -10,11 +10,11 @@ def require_document(lib)
module LightMongo
module Document
- def self.included(klass)
- klass.class_eval("
- include Serialization
+ def self.included(document_class)
+ document_class.class_eval %{
+ include Serialization
include Persistence
- ")
+ }
end
end
end
View
2 lib/document/persistence.rb
@@ -24,7 +24,7 @@ def self.database
module Document
module Persistence
def self.included(document_class)
- document_class.class_eval 'extend ClassMethods'
+ document_class.extend ClassMethods
document_class.collection = Mongo::Collection.new(LightMongo.database, document_class.name)
end
View
2 spec/document/serialization_spec.rb
@@ -104,12 +104,12 @@ class Inner
@inner = Inner.new
@outer = Outer.new(:inner => @inner)
-
@inner.stub!(:save => @inner.object_id)
@outer.stub!(:save => @outer.object_id)
end
it "exports the inner documents" do
+
@inner.should_receive(:export)
@outer.to_hash
end

0 comments on commit d85cf00

Please sign in to comment.
Something went wrong with that request. Please try again.