lib/couch_potato/persistence/attachments.rb in couch_potato-0.5.1 vs lib/couch_potato/persistence/attachments.rb in couch_potato-0.5.2
- old
+ new
@@ -11,10 +11,10 @@
base.extend ClassMethods
end
end
def to_hash
- if _attachments
+ if _attachments && _attachments.any?
super.merge('_attachments' => _attachments)
else
super
end
end
\ No newline at end of file