lib/osm/badge.rb in osm-1.2.2 vs lib/osm/badge.rb in osm-1.2.3
- old
+ new
@@ -355,10 +355,14 @@
if badge.type == :staged
return (earnt > awarded)
end
return false if (completed.eql?(1) && awarded.eql?(1))
return true if (completed.eql?(1) && awarded.eql?(0))
- return (total_gained >= badge.total_needed) && (sections_gained >= badge.sections_needed)
+ if badge.sections_needed == -1 # require all sections
+ return (sections_gained == badge.needed_from_section.keys.size)
+ else
+ return (total_gained >= badge.total_needed) && (sections_gained >= badge.sections_needed)
+ end
end
# Get what stage which has most recently been earnt
# (using #earnt? will tell you if it's still due (not yet awarded))
# @return [Fixnum] the stage which has most recently been due