diff --git a/app/controllers/alchemy/admin/users_controller.rb b/app/controllers/alchemy/admin/users_controller.rb index 9286277..d394fb9 100644 --- a/app/controllers/alchemy/admin/users_controller.rb +++ b/app/controllers/alchemy/admin/users_controller.rb @@ -2,7 +2,7 @@ module Alchemy module Admin class UsersController < ResourcesController - before_action :set_roles_and_genders, except: [:index, :destroy] + before_action :set_roles, except: [:index, :destroy] load_and_authorize_resource class: Alchemy::User, only: [:edit, :update, :destroy] @@ -67,13 +67,12 @@ def destroy private - def set_roles_and_genders + def set_roles if can_update_role? @user_roles = User::ROLES.map do |role| [User.human_rolename(role), role] end end - @user_genders = User.genders_for_select end def user_params diff --git a/app/models/alchemy/user.rb b/app/models/alchemy/user.rb index 84e9e29..bd574c8 100644 --- a/app/models/alchemy/user.rb +++ b/app/models/alchemy/user.rb @@ -8,7 +8,6 @@ class User < ActiveRecord::Base :lastname, :login, :email, - :gender, :language, :password, :password_confirmation, @@ -41,13 +40,6 @@ def human_rolename(role) Alchemy.t("user_roles.#{role}") end - def genders_for_select - [ - [Alchemy.t('male'), 'male'], - [Alchemy.t('female'), 'female'] - ] - end - def logged_in_timeout Config.get(:auto_logout_time).minutes.to_i end diff --git a/app/views/alchemy/admin/users/_fields.html.erb b/app/views/alchemy/admin/users/_fields.html.erb index 30508b5..ecd3368 100644 --- a/app/views/alchemy/admin/users/_fields.html.erb +++ b/app/views/alchemy/admin/users/_fields.html.erb @@ -1,7 +1,3 @@ -<%= f.input :gender, - collection: @user_genders, - prompt: Alchemy.t('Please choose'), - input_html: {class: 'alchemy_selectbox'} %> <%= f.input :firstname %> <%= f.input :lastname %> <%= f.input :login, autofocus: true %> diff --git a/db/migrate/20131015124700_create_alchemy_users.rb b/db/migrate/20131015124700_create_alchemy_users.rb index 245cbf3..288c767 100644 --- a/db/migrate/20131015124700_create_alchemy_users.rb +++ b/db/migrate/20131015124700_create_alchemy_users.rb @@ -6,7 +6,6 @@ def up t.string "lastname" t.string "login" t.string "email" - t.string "gender" t.string "language" t.string "encrypted_password", limit: 128, default: "", null: false t.string "password_salt", limit: 128, default: "", null: false diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index ced00ef..683d46e 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -276,7 +276,6 @@ t.string "lastname" t.string "login" t.string "email" - t.string "gender" t.string "language" t.string "encrypted_password", limit: 128, default: "", null: false t.string "password_salt", limit: 128, default: "", null: false