Permalink
Browse files

Define persisted? method

Change-Id: I8532f5c5c5ba89c89b9c46f11f59fc376143e6b1
  • Loading branch information...
1 parent bd7c06c commit 7ac873c99004775edf942e9fe1269bf774c0e591 @avsej committed Sep 19, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/couchbase/model.rb
View
@@ -502,6 +502,11 @@ def new?
!@id
end
+ # @return [true, false] Where on on this object persisted in the storage
+ def persisted?
+ !!@id
+ end
+
# Check if the key exists in the bucket
#
# @since 0.0.1

0 comments on commit 7ac873c

Please sign in to comment.