search for: role_item

Displaying 1 result from an estimated 1 matches for "role_item".

2007 Dec 09
4
Help on drying code
...orized_roles(controller, action) specific = self.find_by_controller_and_action(controller, action) all_actions = self.find_by_controller_and_action(controller, ''*'') all_controllers = self.find_by_controller(''*'') role_ids = [] specific.each do |role_item| role_ids << role_item.role_id end all_actions.each do |role_item| role_ids << role_item.role_id end all_controllers.each do |role_item| role_ids << role_item.role_id end role_ids.flatten.uniq end which of course is not DRY at all. I c...