Skip to content

Commit

Permalink
Add language to users csv export
Browse files Browse the repository at this point in the history
  • Loading branch information
tmichaelreis committed Jun 1, 2020
1 parent 9f1f149 commit be38699
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def export_user_info

def users_csv(users)
CSV.generate do |csv|
csv << ['User Name', 'User Last Name', 'User Email', 'User Role', 'Registration Date', 'Branch', 'Zip Code', 'Courses User has Started', 'Courses User has Completed']
csv << ['User Name', 'User Last Name', 'User Email', 'User Role', 'Preferred Language', 'Registration Date', 'Branch', 'Zip Code', 'Courses User has Started', 'Courses User has Completed']

users.each do |user|
row = []
Expand All @@ -60,6 +60,7 @@ def users_csv(users)
row << profile.try(:last_name)
row << user.email
row << user.roles.map(&:name).map(&:capitalize).join(', ')
row << user.preferred_language
row << user.created_at.in_time_zone('Central Time (US & Canada)').strftime('%m-%d-%Y')
row << profile.try(:library_location).try(:name)
row << profile.try(:zip_code)
Expand Down

0 comments on commit be38699

Please sign in to comment.