Skip to content

Commit 1a973f0

Browse files
committed
Remove gender attribute, method, and field from model, controller, and form.
Requesting this information is not necessary in the best case, and open to problems of discrimination and non-inclusion.
1 parent 90aca59 commit 1a973f0

3 files changed

Lines changed: 2 additions & 15 deletions

File tree

app/controllers/alchemy/admin/users_controller.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Alchemy
22
module Admin
33
class UsersController < ResourcesController
44

5-
before_action :set_roles_and_genders, except: [:index, :destroy]
5+
before_action :set_roles, except: [:index, :destroy]
66

77
load_and_authorize_resource class: Alchemy::User,
88
only: [:edit, :update, :destroy]
@@ -67,13 +67,12 @@ def destroy
6767

6868
private
6969

70-
def set_roles_and_genders
70+
def set_roles
7171
if can_update_role?
7272
@user_roles = User::ROLES.map do |role|
7373
[User.human_rolename(role), role]
7474
end
7575
end
76-
@user_genders = User.genders_for_select
7776
end
7877

7978
def user_params

app/models/alchemy/user.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class User < ActiveRecord::Base
88
:lastname,
99
:login,
1010
:email,
11-
:gender,
1211
:language,
1312
:password,
1413
:password_confirmation,
@@ -41,13 +40,6 @@ def human_rolename(role)
4140
Alchemy.t("user_roles.#{role}")
4241
end
4342

44-
def genders_for_select
45-
[
46-
[Alchemy.t('male'), 'male'],
47-
[Alchemy.t('female'), 'female']
48-
]
49-
end
50-
5143
def logged_in_timeout
5244
Config.get(:auto_logout_time).minutes.to_i
5345
end

app/views/alchemy/admin/users/_fields.html.erb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%= f.input :gender,
2-
collection: @user_genders,
3-
prompt: Alchemy.t('Please choose'),
4-
input_html: {class: 'alchemy_selectbox'} %>
51
<%= f.input :firstname %>
62
<%= f.input :lastname %>
73
<%= f.input :login, autofocus: true %>

0 commit comments

Comments
 (0)