Permalink
Browse files

Added key_factory instance method.

  • Loading branch information...
1 parent 8e34938 commit 4960cd5f6e9ca599b721d681ed059f4e11a18b44 @jnunemaker committed Nov 16, 2012
Showing with 10 additions and 0 deletions.
  1. +4 −0 lib/toy/identity.rb
  2. +6 −0 spec/toy/identity_spec.rb
View
@@ -38,5 +38,9 @@ def next_key(object = nil)
end
end
end
+
+ def key_factory
+ self.class.key_factory
+ end
end
end
@@ -45,6 +45,12 @@
end
end
+ describe "#key_factory" do
+ it "returns class key factory" do
+ User.new.key_factory.should eq(User.key_factory)
+ end
+ end
+
describe "initializing the id" do
it "should pass use pass the new object" do
Piece.attribute(:name, String)

0 comments on commit 4960cd5

Please sign in to comment.