Permalink
Browse files

reapply patch from jonas huckestein that fixes 'Can't dup NilClass'

  • Loading branch information...
1 parent b7bfb28 commit ea4d835bf457046958050e63702d81e75061e14e @tylerkovacs committed Nov 2, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/hyper_record.rb
View
@@ -28,6 +28,14 @@ class HyperBase < Base
VALUE_OFFSET = 3
TIMESTAMP_OFFSET = 4
+ # Jonas Fix for "Can't dup NilClass" when dup'ing default_scoping
+ # The default value for default_scoping in ActiveRecord::Base is []
+ # Because it is defined in Base.rb with class_inheritable_accessor,
+ # HyperBase has it's own version that needs to be initialized.
+ # TODO: in the future there may be other HyperRecord::Base class variables
+ # that are initialized in base.rb. They will cause problems, too
+ self.default_scoping = self.superclass.default_scoping
+
def initialize(attrs={})
super(attrs)
self.ROW = attrs[:ROW] if attrs[:ROW] && attrs[:ROW]

0 comments on commit ea4d835

Please sign in to comment.