Skip to content

Commit

Permalink
Add more helpful descriptions for users in flipper
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Aug 16, 2024
1 parent 195724f commit 27a103b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/initializers/flipper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
}
end

# Give a readable description when we add specific users (instead of "User;1234" for example)
config.actor_names_source = ->(actor_ids) {
db_ids = actor_ids.select{|id| id.split(';')[0] == "User"}.map{|id| id.split(';')[1] }
users = User.where(id: db_ids)
users.map{|u| ["User;#{u.id}", u.name_with_fallback]}.to_h
}

# Defaults to false. Set to true to show feature descriptions on the list
# page as well as the view page.
config.show_feature_description_in_list = true
Expand Down

0 comments on commit 27a103b

Please sign in to comment.