I am trying to update another associated table before saving but i am getting into errors i am not familiar with...
so i have in my model
post.rb
before_save :update_total_items
def update_total_items
b = Tags.find(:tag_id => self.tag_id)
b.total_items = b.total_items+1
b.save
end
but i get an error
Unknown key tag_id
so how can i access the property i am adding before i save it in order to use it and update an existing associated on another table?