lib/picky/bundle.rb in picky-3.6.10 vs lib/picky/bundle.rb in picky-3.6.11
- old
+ new
@@ -57,11 +57,11 @@
@similarity_strategy = similarity_strategy
reset_backend
end
def identifier
- "#{category.identifier}:#{name}"
+ :"#{category.identifier}:#{name}"
end
# If no specific backend has been set,
# uses the category's backend.
#
@@ -125,14 +125,16 @@
# Note: Does not return itself.
#
def similar text
code = similarity_strategy.encoded text
similar_codes = code && @similarity[code]
- if similar_codes
- similar_codes = similar_codes.dup # TODO
+ if similar_codes.blank?
+ [] # Return a simple array.
+ else
+ similar_codes = similar_codes.dup
similar_codes.delete text
+ similar_codes
end
- similar_codes || []
end
# If a key format is set, use it, else delegate to the category.
#
def key_format
\ No newline at end of file