Chore: Add Facebook app set up documentation (#647)

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
Sojan Jose
2020-03-28 11:43:02 +05:30
committed by GitHub
parent 209e0a0fb4
commit a3c2d4e5bd
23 changed files with 211 additions and 38 deletions

View File

@@ -30,6 +30,18 @@ class Attachment < ApplicationRecord
base_data.merge(file_metadata)
end
def file_url
file.attached? ? url_for(file) : ''
end
def thumb_url
if file.attached? && file.representable?
url_for(file.representation(resize: '250x250'))
else
''
end
end
private
def file_metadata
@@ -64,16 +76,4 @@ class Attachment < ApplicationRecord
account_id: account_id
}
end
def file_url
file.attached? ? url_for(file) : ''
end
def thumb_url
if file.attached? && file.representable?
url_for(file.representation(resize: '250x250'))
else
''
end
end
end