Closed joshmcarthur closed 11 years ago
@jarsbe this is blocking me right now due to the DB constraints on keys that expect to be there but aren't. It's no big deal, I'll just take a look at searching instead.
@joshmcarthur, you're completely right with removing category_id and type_id. Happy to discuss anything tomorrow if you're uncomfortable clearing it up. As for Addresify (feel free to rename that!) the relevant model must have a region but not necessarily a city.
Closed by f966f60af5fa1d5a567ec1e39abc4ecd6dfc3b49
@jarsbe,
I was going to fix this myself, but I think it's probably part of a wider issue you should take a look at.
If you take a look at
db/schema.rb#jobs
alongside theJob
model, you'll see that the associations are a little funky - there are some ID columns that are there that shouldn't be, some associations that have the wrong type, and some associations that should have an ID column that don't.has_one :categorisation
means you don't needcategory_id
has_one :classification
means you don't needtype_id
belongs_to
relationship toCity
ANDRegion
- perhapsJob belongs_to City, Job has_one Region through City
?Have a look anyway, and I'm happy to talk about it tomorrow.