Skip to content
Browse files

goodbye TERRIBLE HORRIBLE NO GOOD VERY BAD HACK!

calling `super` at the bottom does the healthy initialization. Thanks to this commit again! amatsuda@cb65a17
  • Loading branch information...
1 parent f2407f9 commit e4ec3ad45096af3fd32a7da82a92bd253aa5b963 @amatsuda amatsuda committed Apr 19, 2011
Showing with 0 additions and 9 deletions.
  1. +0 −9 lib/kaminari/models/active_record_extension.rb
View
9 lib/kaminari/models/active_record_extension.rb
@@ -5,15 +5,6 @@ module ActiveRecordExtension
extend ActiveSupport::Concern
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
- default_scopes = kls.respond_to?(:default_scoping) ? kls.default_scoping : kls.default_scopes
- unless default_scopes
- new_inheritable_attributes = Hash[inheritable_attributes.map do |key, value|
- [key, value.duplicable? ? value.dup : value]
- end]
- kls.instance_variable_set('@inheritable_attributes', new_inheritable_attributes)
- end
-
kls.class_eval do
include Kaminari::ConfigurationMethods

0 comments on commit e4ec3ad

Please sign in to comment.
Something went wrong with that request. Please try again.