Address @nilsding's review comments

- Fix types on legacy attachment migrations
- Restore Action Mailer setup for development env
- Use `Hash#dig` in CarrierWave initializer
This commit is contained in:
Karina Kwiatek 2020-05-06 16:13:44 +01:00 committed by Dominik M. Kwiatek
parent ff9741589d
commit 5c0871f33c
4 changed files with 12 additions and 6 deletions

View File

@ -29,8 +29,14 @@ Rails.application.configure do
# Action Mailer Setup
# if you want to test sending mails locally, uncomment the line below and comment the :sendmail line
# config.action_mailer.delivery_method = :letter_opener
if ENV["mailcatcher"] == "yes"
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
elsif ENV["letteropener"] == "yes"
config.action_mailer.delivery_method = :letter_opener
else
config.action_mailer.delivery_method = :sendmail
end
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

View File

@ -6,7 +6,7 @@ CarrierWave.configure do |config|
config.fog_directory = "/system"
unless APP_CONFIG["fog"].nil?
config.fog_credentials = APP_CONFIG["fog"]["credentials"] unless APP_CONFIG["fog"]["credentials"].nil?
config.fog_directory = APP_CONFIG["fog"]["directory"] unless APP_CONFIG["fog"]["directory"].nil?
config.fog_credentials = APP_CONFIG.dig("fog", "credentials") unless APP_CONFIG.dig("fog", "credentials").nil?
config.fog_directory = APP_CONFIG.dig("fog", "directory") unless APP_CONFIG.dig("fog", "directory").nil?
end
end

View File

@ -3,7 +3,7 @@ class AddAttachmentProfilePictureToUsers < ActiveRecord::Migration[4.2]
change_table :users do |t|
t.string :profile_picture_file_name
t.string :profile_picture_content_type
t.bigint :profile_picture_file_size
t.integer :profile_picture_file_size
t.datetime :profile_picture_updated_at
end
end

View File

@ -3,7 +3,7 @@ class AddAttachmentProfileHeaderToUsers < ActiveRecord::Migration[4.2]
change_table :users do |t|
t.string :profile_header_file_name
t.string :profile_header_content_type
t.bigint :profile_header_file_size
t.integer :profile_header_file_size
t.datetime :profile_header_updated_at
t.boolean :profile_header_processing
t.integer :crop_h_x