ActiveRecord::Base subclasses that are defined before Kaminari is loaded now get the proper mixins #119

merged 1 commit into from Aug 21, 2011


None yet

4 participants


We have a gem that provides an ActiveRecord::Base subclass. However, since it is loaded by Bundler before the self.included hook is mixed into to ActiveRecord::Base, it never gets the "page" scope.

With our fix, mixing in the module will back-fill existing subclasses with the scope.

Grant Hutchins & Sam Obukwelu Active Record models that were subclassed before Kaminari::ActiveReco…
…rdExtension is included pick up the extensions.

I also had the problem of not having pagination of these model, in my case it was the Audit model. I switched to Casecommons's repo and it worked :)


I'm using the acts_as_audited gem v2.0.0.rc7 and the Audit class would not paginate until I switched to Casecommon's kaminari v0.12.4 repo. This works for me now.

@amatsuda amatsuda merged commit 6998b5f into amatsuda:master Aug 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment