This would be more readable
```ruby
def resource_scope_nested(options)
  if nested_obj && nested_obj.respond_to?(options[:association])
    association = nested_obj.send(options[:association])
    if association.respond_to?(:authorized)
      association.authorized(options[:permission], resource_class)
    else
      association
    end
  else
    resource_scope_not_nested(options)
  end
end
```