diff --git a/lib/kaminari/active_record_extension.rb b/lib/kaminari/active_record_extension.rb index cb8ea6e..6724df5 100644 --- a/lib/kaminari/active_record_extension.rb +++ b/lib/kaminari/active_record_extension.rb @@ -2,7 +2,6 @@ require File.join(File.dirname(__FILE__), 'active_record_relation_methods') module Kaminari module ActiveRecordExtension extend ActiveSupport::Concern - include Kaminari::ConfigurationMethods included do def self.inherited(kls) #:nodoc: # TERRIBLE HORRIBLE NO GOOD VERY BAD HACK: inheritable_attributes is not yet set here on AR 3.0 @@ -14,6 +13,8 @@ module Kaminari end kls.class_eval do + include Kaminari::ConfigurationMethods + # Fetch the values at the specified page number # Model.page(5) scope :page, Proc.new {|num| diff --git a/spec/models/default_per_page_spec.rb b/spec/models/default_per_page_spec.rb index 2a6e934..34d7af4 100644 --- a/spec/models/default_per_page_spec.rb +++ b/spec/models/default_per_page_spec.rb @@ -1,6 +1,11 @@ require File.expand_path('../spec_helper', File.dirname(__FILE__)) describe 'default per_page' do + describe 'AR::Base' do + subject { ActiveRecord::Base } + it { should_not respond_to :paginates_per } + end + subject { User.page 0 } context 'by default' do