public
Rubygem
Description: Extras for DataMapper, including bridges to DataObjects::Migrations and Merb::DataMapper
Homepage: http://datamapper.org
Clone URL: git://github.com/sam/dm-more.git
update README view example to match recent changes
monki (author)
Mon Jul 21 11:04:44 -0700 2008
commit  ac7c4c301dd07f511cd38d01fa4be762a94891dc
tree    5dc7f9ed3b998349a29ea2df99b325d0921e9096
parent  452c96bdd35726137a95720a65762b3df2bdf92b
...
21
22
23
24
 
25
26
27
...
21
22
23
 
24
25
26
27
0
@@ -21,7 +21,7 @@ class User
0
   include DataMapper::Resource
0
 
0
   property :name, String
0
- view :by_name, "function(doc) { if (doc.type == 'user') map(doc.name, doc) }"
0
+ view :by_name, { "map" => "function(doc) { if (doc.type == 'user') { emit(doc.name, doc); } }" }
0
 end
0
 
0
 You could then call User.by_name to get a listing of users ordered by name, or pass a key to try and find a specific user by their name, ie User.by_name(:key => 'username').

Comments

    No one has commented yet.