Associations counting

Hi,
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?
Ranieri T.


Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
armazenamento!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs