def save(options = {})
      return create(options) unless @meta
      if respond_to?(:valid?) && !valid?
        return false
      end
      options = model.defaults.merge(options)
      value = (options[:format] == :plain) ?  @raw : attributes_with_values
      @meta['cas'] = model.bucket.replace(@id, value, options)
      self
    end
def save(options = {})
      return create(options) unless @meta
      if respond_to?(:valid?) && !valid?
        return false
      end
      options = model.defaults.merge(options)
      value = (options[:format] == :plain) ?  @raw : attributes_with_values
      @meta['cas'] = model.bucket.replace(@id, value, options)
      self
    end
Create or update this object based on the state of #new?.

 @since 0.0.1

 @param [Hash] options options for operation, see
   {{Couchbase::Bucket#set}}

 @return [Couchbase::Model, false] saved object or false if there
   are validation errors

 @example Update the Post model
   p = Post.find('hello-world')
   p.draft = false
   p.save

 @example Use CAS value for optimistic lock
   p = Post.find('hello-world')
   p.draft = false
   p.save('cas' => p.meta['cas'])