Skip to content

Commit

Permalink
fix: avo time_zone options (#1952)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Feb 19, 2025
1 parent f835727 commit 7a438fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/avo/resources/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def fields
field :name, as: :text
field :slug, as: :text
field :being_destroyed, as: :boolean, hide_on: :forms
field :time_zone, as: :select, options: -> { view_context.time_zone_options_for_select(Avo::Current.user.time_zone, nil, ActiveSupport::TimeZone) }
field :time_zone, as: :select, options: -> {
ActiveSupport::TimeZone.all.map { |tz| ["(GMT#{tz.formatted_offset}) #{tz.name}", tz.name] }.to_h

Check failure on line 19 in app/avo/resources/team.rb

View workflow job for this annotation

GitHub Actions / 🔬 Standardrb / lint

Layout/TrailingWhitespace: Trailing whitespace detected.
}
field :locale, as: :text
field :users, as: :has_many, through: :memberships
field :memberships, as: :has_many
Expand Down
4 changes: 3 additions & 1 deletion app/avo/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def fields
field :email, as: :text
field :first_name, as: :text
field :last_name, as: :text
field :time_zone, as: :select, options: -> { view_context.time_zone_options_for_select(Avo::Current.user.time_zone, nil, ActiveSupport::TimeZone) }
field :time_zone, as: :select, options: -> {

Check failure on line 18 in app/avo/resources/user.rb

View workflow job for this annotation

GitHub Actions / 🔬 Standardrb / lint

Layout/TrailingWhitespace: Trailing whitespace detected.
ActiveSupport::TimeZone.all.map { |tz| ["(GMT#{tz.formatted_offset}) #{tz.name}", tz.name] }.to_h
}
field :current_team, as: :belongs_to

field :teams, as: :has_many, through: :teams
Expand Down

0 comments on commit 7a438fc

Please sign in to comment.