diff --git a/Gemfile b/Gemfile index b28a65a..3d994b6 100644 --- a/Gemfile +++ b/Gemfile @@ -56,6 +56,7 @@ gem "simple_form", github: "heartcombo/simple_form" gem "pundit" gem 'gravatar_image_tag' gem 'erb_lint' # marketplace est linter +gem 'image_processing', '~> 1.2' # gem 'turbolinks' # , '~> 2.5', '>= 2.5.3' # https://rubygems.org/gems/turbolinks/versions/2.5.3?locale=pt-BR group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 2239416..a24c74a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -135,6 +135,9 @@ GEM gravatar_image_tag (1.2.0) i18n (1.12.0) concurrent-ruby (~> 1.0) + image_processing (1.12.2) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) io-console (0.6.0) irb (1.6.2) reline (>= 0.3.0) @@ -155,6 +158,7 @@ GEM marcel (1.0.2) matrix (0.4.2) method_source (1.0.0) + mini_magick (4.12.0) mini_mime (1.1.2) minitest (5.17.0) msgpack (1.6.0) @@ -232,6 +236,8 @@ GEM rubocop-ast (1.24.1) parser (>= 3.1.1.0) ruby-progressbar (1.11.0) + ruby-vips (2.1.4) + ffi (~> 1.12) rubyzip (2.3.2) sassc (2.4.0) ffi (~> 1.9) @@ -298,6 +304,7 @@ DEPENDENCIES erb_lint font-awesome-sass (~> 6.1) gravatar_image_tag + image_processing (~> 1.2) jbuilder jsbundling-rails pg (~> 1.1) diff --git a/app/assets/images/istockphoto-1204889002-170667a.jpg b/app/assets/images/istockphoto-1204889002-170667a.jpg new file mode 100644 index 0000000..d0598ed Binary files /dev/null and b/app/assets/images/istockphoto-1204889002-170667a.jpg differ diff --git a/app/assets/stylesheets/components/_banner.scss b/app/assets/stylesheets/components/_banner.scss index 5e0313c..e3cfe28 100644 --- a/app/assets/stylesheets/components/_banner.scss +++ b/app/assets/stylesheets/components/_banner.scss @@ -4,7 +4,7 @@ padding-top: 100px; padding-bottom: 200px; height: 7vh; - background-image: url(https://media.istockphoto.com/photos/thetahealing-concept-meditation-in-process-two-women-having-calm-down-picture-id1204889002?b=1&k=20&m=1204889002&s=170667a&w=0&h=WLeYhojqqVx0z9VdxIRUwCOEgbULFzmT1j_h1oBdLXA=); + background-image: url("istockphoto-1204889002-170667a.jpg"); color: #eee; text-align: center; } diff --git a/db/migrate/20230119231633_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20230119231633_add_service_name_to_active_storage_blobs.active_storage.rb new file mode 100644 index 0000000..a15c6ce --- /dev/null +++ b/db/migrate/20230119231633_add_service_name_to_active_storage_blobs.active_storage.rb @@ -0,0 +1,22 @@ +# This migration comes from active_storage (originally 20190112182829) +class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] + def up + return unless table_exists?(:active_storage_blobs) + + unless column_exists?(:active_storage_blobs, :service_name) + add_column :active_storage_blobs, :service_name, :string + + if configured_service = ActiveStorage::Blob.service.name + ActiveStorage::Blob.unscoped.update_all(service_name: configured_service) + end + + change_column :active_storage_blobs, :service_name, :string, null: false + end + end + + def down + return unless table_exists?(:active_storage_blobs) + + remove_column :active_storage_blobs, :service_name + end +end diff --git a/db/migrate/20230119231634_create_active_storage_variant_records.active_storage.rb b/db/migrate/20230119231634_create_active_storage_variant_records.active_storage.rb new file mode 100644 index 0000000..94ac83a --- /dev/null +++ b/db/migrate/20230119231634_create_active_storage_variant_records.active_storage.rb @@ -0,0 +1,27 @@ +# This migration comes from active_storage (originally 20191206030411) +class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] + def change + return unless table_exists?(:active_storage_blobs) + + # Use Active Record's configured type for primary key + create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t| + t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type + t.string :variation_digest, null: false + + t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + end + + private + def primary_key_type + config = Rails.configuration.generators + config.options[config.orm][:primary_key_type] || :primary_key + end + + def blobs_primary_key_type + pkey_name = connection.primary_key(:active_storage_blobs) + pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name } + pkey_column.bigint? ? :bigint : pkey_column.type + end +end diff --git a/db/migrate/20230119231635_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb b/db/migrate/20230119231635_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb new file mode 100644 index 0000000..93c8b85 --- /dev/null +++ b/db/migrate/20230119231635_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb @@ -0,0 +1,8 @@ +# This migration comes from active_storage (originally 20211119233751) +class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] + def change + return unless table_exists?(:active_storage_blobs) + + change_column_null(:active_storage_blobs, :checksum, true) + end +end diff --git a/db/schema.rb b/db/schema.rb index 11fe0ef..b60ef61 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_03_30_210316) do +ActiveRecord::Schema[7.0].define(version: 2023_01_19_231635) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -30,11 +30,18 @@ t.string "content_type" t.text "metadata" t.bigint "byte_size", null: false - t.string "checksum", null: false + t.string "checksum" t.datetime "created_at", precision: nil, null: false + t.string "service_name", null: false t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true end + create_table "active_storage_variant_records", force: :cascade do |t| + t.bigint "blob_id", null: false + t.string "variation_digest", null: false + t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true + end + create_table "agendadas", force: :cascade do |t| t.datetime "data_hora", precision: nil t.integer "user" @@ -109,6 +116,7 @@ end add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" + add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "inscrs", "cursos" add_foreign_key "inscrs", "users" add_foreign_key "prontuarios", "users"