Skip to content

Commit

Permalink
This should have been how we always did it, I mean, we delete them al…
Browse files Browse the repository at this point in the history
…l on line 42 so why find_or_create when we know they're gone? Also adds position.
  • Loading branch information
parndt committed Apr 2, 2010
1 parent 78127d6 commit 315f98c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/plugins/authentication/app/models/user.rb
Expand Up @@ -41,8 +41,8 @@ def plugins=(plugin_titles)
unless self.new_record? # don't add plugins when the user_id is NULL.
self.plugins.delete_all

plugin_titles.each do |plugin_title|
self.plugins.find_or_create_by_title(plugin_title) if plugin_title.is_a?(String)
plugin_titles.each_with_index do |plugin_title, index|
self.plugins.create(:title => plugin_title, :position => index) if plugin_title.is_a?(String)
end
end
end
Expand Down

0 comments on commit 315f98c

Please sign in to comment.