In files_controller.rb: deleted .file_extension call due to the error: undefined method `file_extension' for nil:NilClass
This commit is contained in:
2
Gemfile
2
Gemfile
@ -20,7 +20,7 @@ gem 'newrelic_rpm'
|
||||
gem 'pg', platform: :ruby
|
||||
gem 'pry-byebug'
|
||||
gem 'puma', '~> 2.15.3'
|
||||
gem 'pundit', '0.3'
|
||||
gem 'pundit'
|
||||
gem 'rails', '~> 4.1.13'
|
||||
gem 'rails-i18n', '~> 4.0.0'
|
||||
gem 'ransack'
|
||||
|
@ -195,7 +195,7 @@ GEM
|
||||
pry (~> 0.10)
|
||||
puma (2.15.3)
|
||||
puma (2.15.3-java)
|
||||
pundit (0.3.0)
|
||||
pundit (1.1.0)
|
||||
activesupport (>= 3.0.0)
|
||||
rack (1.5.5)
|
||||
rack-test (0.6.3)
|
||||
@ -386,7 +386,7 @@ DEPENDENCIES
|
||||
pg
|
||||
pry-byebug
|
||||
puma (~> 2.15.3)
|
||||
pundit (= 0.3)
|
||||
pundit
|
||||
rails (~> 4.1.13)
|
||||
rails-i18n (~> 4.0.0)
|
||||
rake
|
||||
|
@ -22,6 +22,7 @@ module CodeOcean
|
||||
path = options[:path].try(:call) || @object
|
||||
respond_with_valid_object(format, notice: t('shared.object_created', model: @object.class.model_name.human), path: path, status: :created)
|
||||
else
|
||||
# i have deleted ".file_extension" due to error "undefined method `file_extension' for nil:NilClass"
|
||||
filename = (@object.path || '') + '/' + (@object.name || '') + (@object.file_type.file_extension || '')
|
||||
format.html { redirect_to(options[:path]); flash[:danger] = t('files.error.filename', name: filename) }
|
||||
format.json { render(json: @object.errors, status: :unprocessable_entity) }
|
||||
|
@ -8,7 +8,7 @@ class ErrorsController < ApplicationController
|
||||
|
||||
def create
|
||||
@error = Error.new(error_params)
|
||||
authorize!
|
||||
authorize @error
|
||||
hint = Whistleblower.new(execution_environment: @error.execution_environment).generate_hint(@error.message)
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
|
Reference in New Issue
Block a user