lib/picky/categories.rb in picky-4.12.6 vs lib/picky/categories.rb in picky-4.12.7
- old
+ new
@@ -5,10 +5,12 @@
attr_reader :categories, :category_hash
forward :each,
:first,
:map,
+ :map!,
+ :include?,
:to => :categories
each_forward :cache,
:dump,
:empty,
@@ -49,10 +51,10 @@
# Add the given category to the list of categories.
#
def << category
reset_qualifier_mapper # TODO Have an add method on QualifierMapper?
- categories << category
+ categories << category unless categories.include? category # This is wrong, and needs to be handled in index.rb
category_hash[category.name] = category
end
# Find a given category in the categories.
#
\ No newline at end of file