# Cop supports --auto-correct.
Layout/BlockEndNewline:
Exclude:
- - 'app/controllers/auth_sources_controller.rb'
- 'app/controllers/files_controller.rb'
- 'app/models/message.rb'
def autocomplete_for_new_user
results = AuthSource.search(params[:term])
-
- render :json => results.map {|result| {
- 'value' => result[:login],
- 'label' => "#{result[:login]} (#{result[:firstname]} #{result[:lastname]})",
- 'login' => result[:login].to_s,
- 'firstname' => result[:firstname].to_s,
- 'lastname' => result[:lastname].to_s,
- 'mail' => result[:mail].to_s,
- 'auth_source_id' => result[:auth_source_id].to_s
- }}
+ render :json => results.map {|result|
+ {
+ 'value' => result[:login],
+ 'label' => "#{result[:login]} (#{result[:firstname]} #{result[:lastname]})",
+ 'login' => result[:login].to_s,
+ 'firstname' => result[:firstname].to_s,
+ 'lastname' => result[:lastname].to_s,
+ 'mail' => result[:mail].to_s,
+ 'auth_source_id' => result[:auth_source_id].to_s
+ }
+ }
end
private