Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Created February 2, 2017 18:56
Show Gist options
  • Save jcoyne/08c98a4c073910b9d3719de0dbbc3b25 to your computer and use it in GitHub Desktop.
Save jcoyne/08c98a4c073910b9d3719de0dbbc3b25 to your computer and use it in GitHub Desktop.
class Context < CatalogController
def current_ability
Ability.new(User.first)
end
end
=> :current_ability
context = Context.new
=> #<Context:0x007fcdaa2cd268 @_action_has_layout=true, @_routes=nil, @_request=nil, @_response=nil>
results = Hyrax::AdminSetService.new(context).search_results_with_work_count(:read)
results.map { |r| r.first['has_model_ssim'] }
=> [["AdminSet"], ["AdminSet"], ["AdminSet"], ["AdminSet"], ["AdminSet"], ["AdminSet"], ["AdminSet"], ["AdminSet"]]
results.map { |r| r.first['file_set_ids_ssim'] }
=> [nil, nil, nil, nil, nil, nil, nil, nil]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment