From adc4f77f7b185fc74a0a2cf73b6927b78354e361 Mon Sep 17 00:00:00 2001 From: Vaughan Kelly Guy Date: Mon, 15 Sep 2014 19:20:14 -0400 Subject: [PATCH 1/2] failing spec --- spec/model_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/model_spec.rb b/spec/model_spec.rb index 6b6f22e..4cef48b 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -300,3 +300,11 @@ class ProtectedTimestamps end end end + +describe "#all" do + it "should return a new collection" do + x = Task.all.object_id + Task.create + Task.all.object_id.should != x + end +end From 3bd6cafc5fd9e8398f49b017eb569832f2e8c95d Mon Sep 17 00:00:00 2001 From: Vaughan Kelly Guy Date: Mon, 15 Sep 2014 19:22:54 -0400 Subject: [PATCH 2/2] fix the :all method --- motion/adapters/array_model_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/motion/adapters/array_model_adapter.rb b/motion/adapters/array_model_adapter.rb index c7213aa..6142795 100644 --- a/motion/adapters/array_model_adapter.rb +++ b/motion/adapters/array_model_adapter.rb @@ -68,7 +68,7 @@ def find_by_id(id) # Returns query result as an array def all - collection + collection.dup end def order(field_name = nil, &block)