app/models/encodable_job.rb in phocoder-rails-0.0.52 vs app/models/encodable_job.rb in phocoder-rails-0.0.53
- old
+ new
@@ -179,10 +179,12 @@
puts "something went wrong..."
# here we try to fall back if we can't find an Encodable
encodable = params[:class].constantize.find params[:id]
end
puts "encodable = #{encodable.to_json}"
- encodable.filename = File.basename(params[:output][:url]) if encodable.filename.blank?
+ if encodable.respond_to?(:filename) && encodable.filename.blank?
+ encodable.filename = File.basename(params[:output][:url])
+ end
if ActsAsPhocodable.storeage_mode == "local"
encodable.save_url(params[:output][:url])
end
else
puts "find_by_phocoder_job_id_and_phocoder_input_id_and_encodable_type #{params[:job][:id]}, #{params[:input][:id]}, #{params[:class]}"