Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion motion/adapters/array_model_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions spec/model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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