Code style fixes, removed unneeded rescue
This commit is contained in:
parent
3cead93dbc
commit
43363c13e5
2 changed files with 5 additions and 7 deletions
|
|
@ -59,7 +59,7 @@ module OpenGraphHelper
|
|||
end
|
||||
|
||||
def oembed_image_tag(cache, prefix)
|
||||
image_tag(cache.data[prefix + 'url'], cache.options_hash(prefix))
|
||||
image_tag(cache.data["#{prefix}url"], cache.options_hash(prefix))
|
||||
end
|
||||
private
|
||||
|
||||
|
|
|
|||
|
|
@ -29,17 +29,15 @@ class OpenGraphCache < ActiveRecord::Base
|
|||
|
||||
def fetch_and_save_opengraph_data!
|
||||
response = OpenGraph.new(self.url)
|
||||
if response.blank? || response.type.blank?
|
||||
return
|
||||
end
|
||||
rescue
|
||||
# noop
|
||||
else
|
||||
|
||||
return if response.blank? || response.type.blank?
|
||||
|
||||
self.title = response.title
|
||||
self.ob_type = response.type
|
||||
self.image = response.images[0]
|
||||
self.url = response.url
|
||||
self.description = response.description
|
||||
|
||||
self.save
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue