Permalink
Browse files

support split design documents per view

  • Loading branch information...
1 parent 8a506d3 commit 5dfbc514c1b3a167cd8cb0948941a728246ed753 @jweiss committed Apr 4, 2011
Showing with 317 additions and 310 deletions.
  1. +6 −2 lib/rocking_chair/view.rb
  2. +1 −1 test/fixtures/simply_stored_fixtures.rb
  3. +310 −307 test/simply_stored_test.rb
@@ -18,10 +18,10 @@ def initialize(database, design_document_name, view_name, options = {})
@design_document = JSON.parse(database.storage["_design/#{design_document_name}"], :create_additions => false)
@view_document = design_document['views'][view_name] || RockingChair::Error.raise_404
end
-
+
@database = database
@keys = database.storage.keys
- @design_document_name = design_document_name
+ @design_document_name = normalize_design_document_name(design_document_name)
@view_name = view_name
initialize_ruby_store
@@ -311,5 +311,9 @@ def normalize_descending_options
end
end
+ def normalize_design_document_name(design_doc_name)
+ design_doc_name.to_s.gsub(/_view_\w+/, '')
+ end
+
end
end
@@ -29,7 +29,7 @@ class Manager
has_one :project
end
-class CustomViewUser
+class CustomFiewUser
include SimplyStored::Couch
property :tags
Oops, something went wrong.

0 comments on commit 5dfbc51

Please sign in to comment.