fixes "undefined method `id' for nil:NilClass: searching model "dmsf_files""
seems sometimes dmsf_file.project is nil
This commit is contained in:
parent
e94676b6a4
commit
86829597b6
@ -353,7 +353,11 @@ class DmsfFile < ActiveRecord::Base
|
||||
if x.is_a?(ActiveRecord::Relation)
|
||||
project_included = x.first.id == dmsf_file.project.id
|
||||
else
|
||||
project_included = x[:id] == dmsf_file.project.id
|
||||
if dmsf_file.project
|
||||
project_included = x[:id] == dmsf_file.project.id
|
||||
else
|
||||
project_included = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user