Setting decent_configuration does not work #53

Closed
ream88 opened this Issue Jul 26, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

ream88 commented Jul 26, 2012

Setting decent_configuration in my ApplicationController or any subclass does not work at all…

decent_configuration do
  strategy Class.new(DecentExposure::ActiveRecordStrategy) do
    def collection_resource
      super.decorate
    end

    def singular_resource
      super.decorate
    end
  end
end

jgdavey closed this in e1e569e Jul 27, 2012

Contributor

jgdavey commented Jul 27, 2012

Thanks for pointing this out. It should work now.

Contributor

ream88 commented Jul 27, 2012

Yep thanks, setting on the same class as needed works now, however when set in ApplicationController the configuration isn't propagated to subclasses of it:

class ApplicationController < ActionController::Base
  decent_configuration do
    strategy MyAwesomeStrategy
  end
end

class UsersController < ApplicationController
  # Uses again the default strategy, not my custom one
  expose(:users)
end

So I suggest to reopen this issue.

jgdavey reopened this Jul 28, 2012

jgdavey closed this in 7875f50 Jul 30, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment