The problem seemed to be that calling a random method (like :flatten), would cause the entity to be retrieved from netbox whether the entity had an :id or not. In my case, the newly initialized entities weren't saved yet causing a LocalError to be raised.
I had to change the functionality. When !ids_set?, the instance won't be loaded from netbox but will raise NoMethodError instead of LocalError. It seems more accurate imho.
This fixes [Entity.new].flatten, because NoMethodError will now be raised.
I'm curious as to what you think of this change. Please keep in mind I have little experience with TDD.
Hi, this fixes issue #39 .
The problem seemed to be that calling a random method (like :flatten), would cause the entity to be retrieved from netbox whether the entity had an :id or not. In my case, the newly initialized entities weren't saved yet causing a LocalError to be raised.
I had to change the functionality. When !ids_set?, the instance won't be loaded from netbox but will raise NoMethodError instead of LocalError. It seems more accurate imho.
This fixes [Entity.new].flatten, because NoMethodError will now be raised.
I'm curious as to what you think of this change. Please keep in mind I have little experience with TDD.
Kind regards, tvl2386