Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tidy up inclusions/extensions.

  • Loading branch information...
commit d85cf00044970170e29188ffa8075f318dcac3e1 1 parent e77bff3
@elliotcm elliotcm authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.