From 6070da8a5cb0132eeb10074415c78853c77c8e70 Mon Sep 17 00:00:00 2001 From: Dirk Kelly Date: Fri, 25 Feb 2011 11:47:12 +0800 Subject: [PATCH] added some helper methods to content_types liquid drops (via @KarlBright) --- lib/locomotive/liquid/drops/contents.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/locomotive/liquid/drops/contents.rb b/lib/locomotive/liquid/drops/contents.rb index cfa58cf6..65a2e1c2 100644 --- a/lib/locomotive/liquid/drops/contents.rb +++ b/lib/locomotive/liquid/drops/contents.rb @@ -28,6 +28,18 @@ module Locomotive def each(&block) self.collection.each(&block) end + + def size + self.collection.size + end + + def empty? + self.collection.empty? + end + + def any? + self.collection.any? + end def api { 'create' => @context.registers[:controller].send('admin_api_contents_url', @content_type.slug) }