diff options
author | Logan Fick <logaldeveloper@protonmail.com> | 2017-10-12 18:04:31 -0400 |
---|---|---|
committer | Logan Fick <logaldeveloper@protonmail.com> | 2017-10-12 18:04:31 -0400 |
commit | fd40ac82ff501d6a0bd346d4503daded86213b4a (patch) | |
tree | 59b46ba53bc432c56a1152b7549d30b722fdcf38 | |
parent | 908e67482c7816efcde842b50faa5255ee823a40 (diff) | |
parent | a323613b9a8015b0643d3b7ba2dca7a03fa81e7f (diff) |
Merge pull request #34.
-rw-r--r-- | app/controllers/users_controller.rb | 4 | ||||
-rw-r--r-- | app/views/users/edit.html.erb | 6 | ||||
-rw-r--r-- | app/views/users/show.html.erb | 2 | ||||
-rw-r--r-- | db/migrate/20170708011014_remove_skype_visibility_from_users.rb | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 315b767..5f2c892 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -137,9 +137,9 @@ class UsersController < ApplicationController def update if (mod? && current_user.role >= @user.role ) || (@user.is?(current_user) && confirmed?) if mod? - userdata = user_params([:name, :skype, :skype_public, :youtube, :twitter, :about, :role, :badge, :confirmed, :header_scroll, :utc_time, :dark]) + userdata = user_params([:name, :skype, :youtube, :twitter, :about, :role, :badge, :confirmed, :header_scroll, :utc_time, :dark]) else - userdata = user_params([:name, :skype, :skype_public, :youtube, :twitter, :about, :header_scroll, :utc_time, :dark]) + userdata = user_params([:name, :skype, :youtube, :twitter, :about, :header_scroll, :utc_time, :dark]) end if User.find_by(name: userdata[:name]) flash[:alert] = "You have entered a name that belongs to someone else. Please try another." diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 133a69d..abd1fa4 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -49,12 +49,6 @@ </td> </tr> <tr> - <td>Show Skype to</td> - <td> - <%= f.select :skype_public, [["Staff only", false], ["All users", true]], {}, { disabled: !can_edit? } %> - </td> - </tr> - <tr> <td>YouTube Channel ID</td> <td> <%= f.text_field :youtube, placeholder: "YouTube Channel ID", disabled: !can_edit? %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e371a09..794d2e2 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -52,7 +52,7 @@ <td><b>Role</b></td> <td><%= link_to @user.role, users_path(:role => @user.role.name) %></td> </tr> - <% if current_user && !@user.skype.blank? && (@user.skype_public || current_user == @user || mod?) %> + <% if current_user && !@user.skype.blank? %> <tr> <td><b>Skype</b></td> <td><%= link_to @user.skype, "skype:#{@user.skype}?chat", target: "_blank" %></a></td> diff --git a/db/migrate/20170708011014_remove_skype_visibility_from_users.rb b/db/migrate/20170708011014_remove_skype_visibility_from_users.rb new file mode 100644 index 0000000..92a9482 --- /dev/null +++ b/db/migrate/20170708011014_remove_skype_visibility_from_users.rb @@ -0,0 +1,6 @@ +class RemoveSkypeVisibilityFromUsers < ActiveRecord::Migration + def change + remove_column :users, :skype_public + User.update_all skype: nil + end +end |