How to fix Ruby on Rails obj != nil error -


i'm trying ensure object not nil in ruby on rails , i'm getting error:

called id nil, mistakenly 4 -- if wanted id of nil, use object_id 

this object looks in debugger (it not nil):

enter image description here

how correctly check nil in case? cases?

i've found similar posts not specific case: check nil gives error, , called id nil, mistakenly 4 -- if wanted id of nil, use object_id.

the != comparator using id check equality. checking if ob1.id != ob2.id, or in case map_set.id != nil.id

to check if object nil, can check if object has value. if object or if !object.nil?


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -