views:

99

answers:

0

hi

I have a menu class and that have many menu_items and a menu_item class that is embedded docuemnt.

I can get a specific menu like

menu = Menu.find_by_name("menu 1")

then i want to find and update or create the menu_item that matches a specific category id.

I want to create the menu item if category id is not found in menu items attributes but if found i want to add 1 to the value attribute in the matching menu_item.

Can anyone help me do this? also i think think is possible in 1 atomic operation ???

thanks alot rick