Displaying 1 result from an estimated 1 matches for "role_items".
Did you mean:
role_item
2007 Dec 09
4
Help on drying code
..._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(''*'')
#
# MAGIC
#
role_ids = []
role_items do |role_item|
role_ids << role_item.role_id
end
role_ids.flatten.uniq
end
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, sen...