I have a model in rails that relates to a game element owned by the user. This weapon has an is_equipped column that reminds you that the item is equipped or not. Game_item can be a weapon, helmet, etc. (Set item_type in the game_item model).
Now I am looking for a good way to get an equipped item for each type. I can do things like get_equipped_item (type) and specify the type, or get_equipped_helmet, get_equipped_weapon, etc. I'm looking for a better way to do this, rails way :) Any ideas?
source
share