lib/can_play/ability.rb in can_play-0.2.8 vs lib/can_play/ability.rb in can_play-0.2.9

- old
+ new

@@ -6,10 +6,10 @@ self.user = user||CanPlay::Config.user_class_name.constantize.new CanPlay::Config.super_roles.each do |role_name| can(:manage, :all) if user.send(CanPlay::Config.role_judge_method, role_name) end CanPlay::Config.role_class_name.constantize.all.each do |role| - next unless user.role?(role.name) + next unless user.send(CanPlay::Config.role_judge_method, role) role.send(CanPlay::Config.role_resources_relation_name).each do |role_resource| resource = CanPlay.find_by_name_and_code(role_resource.resource_name, CanPlay.override_code) next unless resource if resource[:type] == 'collection' if resource[:behavior] \ No newline at end of file