ruby - ROR + Error For nil:NilClass In Rake Task -


in rake command calling xml retrieve data. if person_id valid, saved. getting error.

if !@case.person_id.nil?     @project.team_members << @person  end 

error :: rake aborted! undefined method `team_members' nil:nilclass

please suggest thing !!!

@project nil variable , why cannot invoke team_members. check how define it. moreover, may want follow ruby way of doing things. 'if not' occasions better write :

unless @case.person_id.nil?   ... 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -