search for: find_by_controller

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

2007 Dec 09
4
Help on drying code
Hi all, Currently I''m having to do this: def self.authorized_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_ac...