diff options
author | alpaca-tc <alpaca-tc@alpaca.tc> | 2017-05-19 18:41:45 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-19 11:41:45 +0200 |
commit | 198ae3e36688e6282c6d1a699b4e1874d642f1e9 (patch) | |
tree | 64b1770e564d62407ed18fa8b94c27522265d296 /app/models/concerns/account_avatar.rb | |
parent | 6e4c7d62118d5d1f2e966950edfdbc80cebd4d7c (diff) |
Define instance method outside #included (#3128)
Diffstat (limited to 'app/models/concerns/account_avatar.rb')
-rw-r--r-- | app/models/concerns/account_avatar.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/concerns/account_avatar.rb b/app/models/concerns/account_avatar.rb index 73507a328..a6527a85b 100644 --- a/app/models/concerns/account_avatar.rb +++ b/app/models/concerns/account_avatar.rb @@ -20,13 +20,13 @@ module AccountAvatar has_attached_file :avatar, styles: ->(f) { avatar_styles(f) }, convert_options: { all: '-quality 80 -strip' } validates_attachment_content_type :avatar, content_type: IMAGE_MIME_TYPES validates_attachment_size :avatar, less_than: 2.megabytes + end - def avatar_original_url - avatar.url(:original) - end + def avatar_original_url + avatar.url(:original) + end - def avatar_static_url - avatar_content_type == 'image/gif' ? avatar.url(:static) : avatar_original_url - end + def avatar_static_url + avatar_content_type == 'image/gif' ? avatar.url(:static) : avatar_original_url end end |