#view method works when auto_update_design_doc is disabled
This commit is contained in:
parent
f28cce1f0a
commit
f2c16144b0
2 changed files with 20 additions and 3 deletions
|
@ -58,10 +58,11 @@ module CouchRest
|
|||
self.model = model
|
||||
end
|
||||
|
||||
# Define a view and generate a method that will provide a new
|
||||
# View instance when requested.
|
||||
# Generate a method that will provide a new View instance when
|
||||
# requested. This will also define the view in CouchDB unless
|
||||
# auto_update_design_doc is disabled.
|
||||
def view(name, opts = {})
|
||||
View.create(model, name, opts)
|
||||
View.create(model, name, opts) if model.auto_update_design_doc
|
||||
create_view_method(name)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue