testmycode/tmc-server

View on GitHub
app/helpers/authorize_collection_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module AuthorizeCollectionHelper
  # This method allows to authorize collections of items
  # TODO: Has to be tested with empty collections and other edge cases
  def authorize_collection(action, collection)
    @_authorized = true
    collection.each { |col| authorize! action, col }
  end
end