Permalink
Browse files

Improved the simple example to show queries

  • Loading branch information...
1 parent 0384ea8 commit 00e98a656b449a0377672c3a766273416e6c4496 @felipero felipero committed May 12, 2010
Showing with 10 additions and 1 deletion.
  1. +10 −1 examples/post_example.rb
View
@@ -1,4 +1,4 @@
-require 'couchrails'
+require 'couch_rails'
class Post < CouchRails::Document
property :title
@@ -15,6 +15,15 @@ class Post < CouchRails::Document
puts "Saved!" if post.save!
+post_recovered = Post.find(post.id) # Post.get(post.id)
+
+puts "Take a look at how it comes back from the DB"
+puts post_recovered
+
+puts "Let's list all posts on the DB"
+posts = Post.all
+puts posts
+
puts "Please check your couchDB installation, you might find one record"
puts "bye!"

0 comments on commit 00e98a6

Please sign in to comment.