Skip to content

Commit

Permalink
Remove unneeded code
Browse files Browse the repository at this point in the history
After casting the max to_i we no longer need to check wether or not there are any plugins
  • Loading branch information
johanb committed May 7, 2015
1 parent 75e670a commit dc60967
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions authentication/app/models/refinery/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,8 @@ def plugins=(plugin_names)
return unless persisted?
plugin_names = string_plugin_names(plugin_names)

if plugins.empty?
plugin_names.each_with_index do |plugin_name, index|
plugins.create(:name => plugin_name, :position => index)
end
else
filtered_names = filter_existing_plugins_for(plugin_names)
create_plugins_for(filtered_names)
end
filtered_names = filter_existing_plugins_for(plugin_names)
create_plugins_for(filtered_names)
end

def authorized_plugins
Expand Down

0 comments on commit dc60967

Please sign in to comment.