Not sure if this is outside the scope of cancan, but I had a need in my current project for stubbing out resources using active hash (ActiveYaml more specifically) before they could be backed by a proper DB and noticed there was a lack of support. This PR allows you to treat active hash objects like regular model classes in the controller and allows for:
class Mock::Stadium < ActiveYaml::Base
fields :name, :city, :state
class Api::V1::StadiumsController < Api::V1::BaseController
load_and_authorize_resource class: Mock::Stadium
Currently it only supports basic scoping and no associations.
adding model adapter for active hash (basic support only right now)
Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013.
Since only Ryan himself has commit permissions, the CanCan project is on a standstill.
CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994.
If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan.
We hope to see you on the other side!