-
-
Save adam12/63632eed4da88e7c1e82d2f0064c8b84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/user.rb b/app/models/user.rb | |
index ca146de..c5d1ac5 100644 | |
--- a/app/models/user.rb | |
+++ b/app/models/user.rb | |
@@ -13,7 +13,7 @@ class User < ApplicationRecord | |
after_create :set_admin | |
def send_to_active_storage | |
- self.avatar = StringIO.new(Identicon.blob_for(email)) | |
+ self.avatar.attach(io: StringIO.new(Identicon.blob_for(email)), filename: "#{email}-avatar.png") | |
end | |
private |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment