Skip to content

Commit

Permalink
Use #detect in Rails to avoid conflicts with AR.find
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Dec 10, 2013
1 parent 1c34142 commit 801e153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_taggable_on/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def self.find_or_create_all_with_like_by_name(*list)

list.map do |tag_name|
comparable_tag_name = comparable_name(tag_name)
existing_tag = existing_tags.find { |tag| comparable_name(tag.name) == comparable_tag_name }
existing_tag = existing_tags.detect { |tag| comparable_name(tag.name) == comparable_tag_name }

existing_tag || Tag.create(:name => tag_name)
end
Expand Down

0 comments on commit 801e153

Please sign in to comment.