couchrest/couchrest_model — Issue #124: .all method changes behavior when "by_" view is defined
Author: estei
Created: 2011-10-23 22:51:08+00:00
State: open

Howdy

Rails 3.1.1
Couchrest_model 1.1.2

If you call for instance

Book.all

when no custom views have been defined on a model it returns an Array.

If you define a view with for instance:

design do
view :by_pages
end

.all now returns a View instead of an Array.
You now have to do, for example

@books = Book.all.all

to extract the array.

Can't think that this is intended behavior.