Skip to content

Commit

Permalink
Merge branch 'dev' into feature/two-sided-contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
felixauringer authored Feb 4, 2021
2 parents e4d0ad4 + 2d80824 commit 8ca23f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions db/migrate/20210204114922_add_default_avatar.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class AddDefaultAvatar < ActiveRecord::Migration[6.0]
def up
User.all.each do |user|
next if user.avatar.attached?

user.avatar.attach(
io: File.open(
Rails.root.join('app/assets/images/default_avatar.png')
), filename: 'default_avatar.png', content_type: 'image/png'
)
user.save
end
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_02_02_132517) do
ActiveRecord::Schema.define(version: 2021_02_04_114922) do

create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
Expand Down

0 comments on commit 8ca23f0

Please sign in to comment.