0
0
Fork 0

Define instance method outside #included (#3128)

This commit is contained in:
alpaca-tc 2017-05-19 18:41:45 +09:00 committed by Eugen Rochko
parent 6e4c7d6211
commit 198ae3e366
5 changed files with 103 additions and 105 deletions

View file

@ -20,13 +20,13 @@ module AccountHeader
has_attached_file :header, styles: ->(f) { header_styles(f) }, convert_options: { all: '-quality 80 -strip' }
validates_attachment_content_type :header, content_type: IMAGE_MIME_TYPES
validates_attachment_size :header, less_than: 2.megabytes
end
def header_original_url
header.url(:original)
end
def header_original_url
header.url(:original)
end
def header_static_url
header_content_type == 'image/gif' ? header.url(:static) : header_original_url
end
def header_static_url
header_content_type == 'image/gif' ? header.url(:static) : header_original_url
end
end