Skip to content

Commit

Permalink
Activate all new framework defaults and fix image type filter of prof…
Browse files Browse the repository at this point in the history
…ile picture upload
  • Loading branch information
RandomTannenbaum committed Feb 11, 2025
1 parent 47c034e commit 4f9f852
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/views/people/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
= t "people.profile.upload_image"
- else
= t "people.profile.change_image"
%div.visually-hidden{"data-controller"=>"image-upload"}= form.file_field :picture, { accept: "image/", "data-action" => "image-upload#changeImage", id: "avatar-uploader" }
%div.visually-hidden{"data-controller"=>"image-upload"}= form.file_field :picture, { accept: "image/*", "data-action" => "image-upload#changeImage", id: "avatar-uploader" }
= form.hidden_field :picture_cache
%div.pe-5.col-xl-3.col-12
%table.w-100
Expand Down
10 changes: 5 additions & 5 deletions config/initializers/new_framework_defaults_7_2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
# backends that use the same database as Active Record as a queue, hence they
# don't need this feature.
#++
# Rails.application.config.active_job.enqueue_after_transaction_commit = :default
Rails.application.config.active_job.enqueue_after_transaction_commit = :default

###
# Adds image/webp to the list of content types Active Storage considers as an image
# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png.
# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support
# WebP. Requires imagemagick/libvips built with WebP support.
#++
# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp]
Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp]

###
# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError
Expand All @@ -51,7 +51,7 @@
# Applications with existing timestamped migrations that do not adhere to the
# expected format can disable validation by setting this config to `false`.
#++
# Rails.application.config.active_record.validate_migration_timestamps = true
Rails.application.config.active_record.validate_migration_timestamps = true

###
# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries.
Expand All @@ -61,10 +61,10 @@
#
# This query used to return a `String`.
#++
# Rails.application.config.active_record.postgresql_adapter_decode_dates = true
Rails.application.config.active_record.postgresql_adapter_decode_dates = true

###
# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are
# deploying to a memory constrained environment you may want to set this to `false`.
#++
# Rails.application.config.yjit = true
Rails.application.config.yjit = true

0 comments on commit 4f9f852

Please sign in to comment.