From 2c989a2cdaad9bbbea92a62d25c48ef94549a515 Mon Sep 17 00:00:00 2001 From: Trevor Stone Date: Sun, 8 Jan 2012 22:08:09 -0700 Subject: [PATCH] Don't double-alias disable_referential_integrity. This fixes "SystemStackError: stack level too deep" in Rails 3.2. --- lib/rails_sql_views/connection_adapters/abstract_adapter.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rails_sql_views/connection_adapters/abstract_adapter.rb b/lib/rails_sql_views/connection_adapters/abstract_adapter.rb index 6f11432..6a5912f 100644 --- a/lib/rails_sql_views/connection_adapters/abstract_adapter.rb +++ b/lib/rails_sql_views/connection_adapters/abstract_adapter.rb @@ -2,7 +2,8 @@ module RailsSqlViews module ConnectionAdapters module AbstractAdapter def self.included(base) - base.alias_method_chain :disable_referential_integrity, :views_excluded + base.alias_method_chain :disable_referential_integrity, :views_excluded \ + unless base.method_defined? :disable_referential_integrity_with_views_excluded end # Subclasses should override and return true if they support views.