'Rails nested fixture is nil

I have two level fixtures like this

#locations.yml
cyes:
  city: Berkeley
  climate_zone: three

#climate_zones.yml
three:
  affiliate_id: 1
  creator: admin

In my tests, some times, when I create a location object through my fixtures, the climate_zone is nil.

location = locations(:cyes)
location.climate_zone # This is nil


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source