Code style fixes, removed unneeded rescue

This commit is contained in:
Fábián Tamás László 2013-06-18 06:43:58 +02:00 committed by Jonne Haß
parent 3cead93dbc
commit 43363c13e5
2 changed files with 5 additions and 7 deletions

View file

@ -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

View file

@ -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