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
|
end
|
||||||
|
|
||||||
def oembed_image_tag(cache, prefix)
|
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
|
end
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,17 +29,15 @@ class OpenGraphCache < ActiveRecord::Base
|
||||||
|
|
||||||
def fetch_and_save_opengraph_data!
|
def fetch_and_save_opengraph_data!
|
||||||
response = OpenGraph.new(self.url)
|
response = OpenGraph.new(self.url)
|
||||||
if response.blank? || response.type.blank?
|
|
||||||
return
|
return if response.blank? || response.type.blank?
|
||||||
end
|
|
||||||
rescue
|
|
||||||
# noop
|
|
||||||
else
|
|
||||||
self.title = response.title
|
self.title = response.title
|
||||||
self.ob_type = response.type
|
self.ob_type = response.type
|
||||||
self.image = response.images[0]
|
self.image = response.images[0]
|
||||||
self.url = response.url
|
self.url = response.url
|
||||||
self.description = response.description
|
self.description = response.description
|
||||||
|
|
||||||
self.save
|
self.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue