From 7293cac8548fb8083f718922d8d3ca9b3a18767f Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 23 Dec 2011 00:36:54 +0000 Subject: Extract common logic into a method --- activerecord/test/cases/attribute_methods/read_test.rb | 1 + activerecord/test/cases/connection_adapters/connection_handler_test.rb | 3 +++ 2 files changed, 4 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/attribute_methods/read_test.rb b/activerecord/test/cases/attribute_methods/read_test.rb index 7665f1c12e..0df9ffc0c5 100644 --- a/activerecord/test/cases/attribute_methods/read_test.rb +++ b/activerecord/test/cases/attribute_methods/read_test.rb @@ -15,6 +15,7 @@ module ActiveRecord def setup @klass = Class.new do def self.superclass; Base; end + def self.active_record_super; Base; end def self.base_class; self; end include ActiveRecord::AttributeMethods diff --git a/activerecord/test/cases/connection_adapters/connection_handler_test.rb b/activerecord/test/cases/connection_adapters/connection_handler_test.rb index 04d543fea9..dc99ac665c 100644 --- a/activerecord/test/cases/connection_adapters/connection_handler_test.rb +++ b/activerecord/test/cases/connection_adapters/connection_handler_test.rb @@ -8,6 +8,9 @@ module ActiveRecord @handler.establish_connection 'america', Base.connection_pool.spec @klass = Class.new do def self.name; 'america'; end + class << self + alias active_record_super superclass + end end @subklass = Class.new(@klass) do def self.name; 'north america'; end -- cgit v1.2.3