From 4c082405d35a847767f2a4e9c493e2752ecaa05c Mon Sep 17 00:00:00 2001 From: Bryan Larsen Date: Wed, 19 May 2010 13:18:32 -0400 Subject: [PATCH] [#721 state:resolved] LifecycleState breaks table-plus sorting (from Matt Jones) --- hobo/lib/hobo/scopes/automatic_scopes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hobo/lib/hobo/scopes/automatic_scopes.rb b/hobo/lib/hobo/scopes/automatic_scopes.rb index 62353c112..35db9fb4b 100644 --- a/hobo/lib/hobo/scopes/automatic_scopes.rb +++ b/hobo/lib/hobo/scopes/automatic_scopes.rb @@ -268,7 +268,7 @@ def create_scope type = klass.attr_type(field) if type.nil? #a virtual attribute from an SQL alias, e.g., 'total' from 'COUNT(*) AS total' colspec = "#{field}" # don't prepend the table name - elsif type.respond_to?(:table_name) && (name = type.name_attribute) + elsif type.respond_to?(:name_attribute) && (name = type.name_attribute) include = field colspec = "#{type.table_name}.#{name}" else