Skip to content

Commit 4f9f852

Browse files
Activate all new framework defaults and fix image type filter of profile picture upload
1 parent 47c034e commit 4f9f852

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/views/people/_form.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
= t "people.profile.upload_image"
1414
- else
1515
= t "people.profile.change_image"
16-
%div.visually-hidden{"data-controller"=>"image-upload"}= form.file_field :picture, { accept: "image/", "data-action" => "image-upload#changeImage", id: "avatar-uploader" }
16+
%div.visually-hidden{"data-controller"=>"image-upload"}= form.file_field :picture, { accept: "image/*", "data-action" => "image-upload#changeImage", id: "avatar-uploader" }
1717
= form.hidden_field :picture_cache
1818
%div.pe-5.col-xl-3.col-12
1919
%table.w-100

config/initializers/new_framework_defaults_7_2.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
# backends that use the same database as Active Record as a queue, hence they
3333
# don't need this feature.
3434
#++
35-
# Rails.application.config.active_job.enqueue_after_transaction_commit = :default
35+
Rails.application.config.active_job.enqueue_after_transaction_commit = :default
3636

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

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

5656
###
5757
# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries.
@@ -61,10 +61,10 @@
6161
#
6262
# This query used to return a `String`.
6363
#++
64-
# Rails.application.config.active_record.postgresql_adapter_decode_dates = true
64+
Rails.application.config.active_record.postgresql_adapter_decode_dates = true
6565

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

0 commit comments

Comments
 (0)