Skip to content

Commit a76d7d5

Browse files
authored
Merge pull request #94 from rmparr/remove-gender
Remove gender
2 parents 17459e3 + 1a973f0 commit a76d7d5

5 files changed

Lines changed: 2 additions & 17 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 %>

db/migrate/20131015124700_create_alchemy_users.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ def up
66
t.string "lastname"
77
t.string "login"
88
t.string "email"
9-
t.string "gender"
109
t.string "language"
1110
t.string "encrypted_password", limit: 128, default: "", null: false
1211
t.string "password_salt", limit: 128, default: "", null: false

spec/dummy/db/schema.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@
276276
t.string "lastname"
277277
t.string "login"
278278
t.string "email"
279-
t.string "gender"
280279
t.string "language"
281280
t.string "encrypted_password", limit: 128, default: "", null: false
282281
t.string "password_salt", limit: 128, default: "", null: false

0 commit comments

Comments
 (0)