Skip to content

Commit

Permalink
Better example of getter
Browse files Browse the repository at this point in the history
  • Loading branch information
pablobm committed Sep 27, 2024
1 parent fd89028 commit 1b26fcb
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions spec/example_app/app/dashboards/customer_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ class CustomerDashboard < Administrate::BaseDashboard
lifetime_value: Field::Number.with_options(prefix: "$", decimals: 2),
foobar: Field::Foobar,
name: Field::String,
nickname: Field::String.with_options(
getter: ->(field) { "Mr. #{field.resource.name}man" if field.resource.name.present? },
searchable: false
),
orders: Field::HasMany.with_options(limit: 2, sort_by: :id),
log_entries: Field::HasManyVariant.with_options(limit: 2, sort_by: :id),
updated_at: Field::DateTime,
Expand Down

0 comments on commit 1b26fcb

Please sign in to comment.