Skip to content

Instantly share code, notes, and snippets.

@courtsimas
Created June 8, 2011 15:34
Show Gist options
  • Save courtsimas/1014653 to your computer and use it in GitHub Desktop.
Save courtsimas/1014653 to your computer and use it in GitHub Desktop.
if profile_route.nil? || !profile_route.respond_to?(profile.to_sym)
self.profile_route = {profile.to_sym => panda_video.encodings.find_by_profile_name('h264').url}
panda_url = profile.to_sym => panda_video.encodings.find_by_profile_name(profile).url
self.profile_route = {profile.to_sym => panda_url} if panda_url.present?
self.save
else profile_route.has_key?(profile.to_sym) && profile_route[profile.to_sym].blank?
self.update_attribute(profile_route[profile.to_sym], panda_video.encodings.find_by_profile_name(profile).url)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment