You can clone with
According to e.g. https://gist.github.com/e139fa787aa882c0aa9c we need to subclass Engine to enable the registration of the authorization development backend when decl_auth is integrated as gem in Rails 3.
One approach is in 1ab1422
Which other features of Engine/Railtie should we be using? Register config hooks?
I haven't looked into all the configuration options available in DA yet, but from the top of my head I would see these two options on the top of the list
1) Get initializer to run under Rails3. I don't mind if it's done the way HAML 2.2.x does it with an init_rails method getting called from vendor/plugins/haml or by subclassing Engine. If it's going to be done the vendor/plugins way, generators for Rails2 and Rails3 should be added to DA.
2) Add a config hook for the authorization rules file(s). I think it would be much cleaner than setting constants early on in the rails boot process.
On (1): not sure, how my environment can be different from yours, but in my case I don't need the explicit railtie to have decl_auth working as a gem in Rails 3. Anyway, I pushed your commit. Hopefully, this helps.
Thank you, works as charm now with the "official" version. I don't know what's different either, but I can consistently reproduce it on three machines just using Rails3 + DA, no other Gems involved.
I'll try it on a different OS just for fun, as all test machines are Macs.
I worked around this by adding the following to my config/initializers/application.rb file:
AUTH_DSL_FILES.replace([Pathname.new(Rails.root || '').join("config", "authorization_rules.rb").to_s])