Is that exactly the code you have? because you’d need to actually specify the name of the correct model (e.g. in the case you’ve provided you’d need to say belongs_to :rate and not belongs_to :something).
If the name of the class is different from the name of the relation you want to use, you need to specify :class_name in your belongs_to declaration.
No, it was a typo in my original post. The models were a little more complex than as posted, but I’ve stripped them down to what you see now in my original (edited) post and it’s having non of it.
Now I’m seeing one more potential issue: you have class SomeThing camel-cased. If that’s indeed the case, you should be using item.some_thing and not item.something … Rails automatically inflects your camel-cased names for use in file names and database tables, and that’s also reflected in the accessor methods generated by belongs_to or has_many.
At this point the method some_thing of your item isn’t throwing an error like it was before, so your association is set up correctly. However, you’re getting nil when retrieving the some_thing associated with that particular item, which would imply that it doesn’t have one. Try creating a new item and make sure there’s a some_thing associated with it. If you’re looping over a list of items, and only some of them will have some_things, you’ll need to check to see if they’re there before trying to get their properties: