Permalink
Browse files

fixed a bug in if_assets

  • Loading branch information...
1 parent 64a3824 commit 9d555b438cab46a9147930a13abac3168708ef59 @kbingman kbingman committed May 26, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/models/asset_tags.rb
View
@@ -67,7 +67,7 @@ class TagError < StandardError; end
<pre><code><r:if_assets [min_count="n"] [extensions="pdf|jpg"]>...</r:if_assets></code></pre>
}
tag 'if_assets' do |tag|
- count = tag.attr['min_count'] && tag.attr['min_count'].to_i || 0
+ count = tag.attr['min_count'] && tag.attr['min_count'].to_i || 1
assets = tag.locals.page.assets.count(:conditions => assets_find_options(tag)[:conditions])
tag.expand if assets >= count
end
@@ -76,7 +76,7 @@ class TagError < StandardError; end
The opposite of @<r:if_attachments/>@.
}
tag 'unless_assets' do |tag|
- count = tag.attr['min_count'] && tag.attr['min_count'].to_i || 0
+ count = tag.attr['min_count'] && tag.attr['min_count'].to_i || 1
assets = tag.locals.page.assets.count(:conditions => assets_find_options(tag)[:conditions])
tag.expand unless assets >= count
end

0 comments on commit 9d555b4

Please sign in to comment.