I'm trying to display the status of a model Pack based on a model Status.
The number of possible statuses is small, while there are many packs and each has a status.
I expect the status table will also be referenced by other models at a later stage.
I've added this to routes:
resources :packs do
resources :statuses
end
And added a:
has_one :status
to packs.rb.
When I try to call the following from the view:
<%= pack.status.status %>
I get the following controller error:
PG::UndefinedColumn: ERROR: column statuses.pack_id does not exist
Clearly, I don't have this set up right, but I don't want statuses to reference packs.
How do I remove this association?
I tried using:
statuses.rb:
has_many :battery_packs
But then I removed it, and the error persisted.
So it may be that I need to roll-back a migration or something, but I'm not sure how to check.