I’m using the models, User, Item, and Add.
Add belongs_to User (with counter_cache enabled)
Add belongs_to Item (also, with counter_cache enabled)
User has_many adds, and has_many items through adds
Item has_many adds, and has_many users through adds
When I go to save a new Item, I want to create a new Add for this, with the proper (loged in) User:
@item.adds.create :user => @current_user
In the view, the number of items is displayed currectly, but in the database it is shown as 0, if I looking at the items table; at the same time the table users show: adds_count = 1, or the currect number of adds.
Why? How can I fix it?