1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-11 13:15:20 +00:00

Fix undefined method when auth source name column is added as column (#37674).

git-svn-id: https://svn.redmine.org/redmine/trunk@21861 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu 2022-09-27 19:55:09 +00:00
parent 1678f0d57a
commit 20baf029ba
2 changed files with 18 additions and 0 deletions

View File

@ -72,6 +72,10 @@ class AuthSource < ActiveRecord::Base
false
end
def visible?(user=User.current)
user.admin?
end
def self.search(q)
results = []
AuthSource.all.each do |source|

View File

@ -175,6 +175,20 @@ class UsersControllerTest < Redmine::ControllerTest
end
end
def test_index_with_auth_source_column
user = User.find(1)
user.update_column :auth_source_id, 1
get :index, params: {
set_filter: 1,
f: ['auth_source_id'], op: {auth_source_id: '='}, v: {auth_source_id: ['1']},
c: %w(login firstname lastname mail auth_source.name)
}
assert_response :success
assert_select 'tr#user-1', 1
end
def test_index_csv
with_settings :default_language => 'en' do
user = User.logged.status(1).first