From 2c0ce104e7c0e56bf7ce4f0c2f71547c1d3b07fb Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 17 Apr 2010 12:14:52 +0000 Subject: [PATCH] Fixed: Error on db:migrate with table prefix set (#5335). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3678 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/principal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/principal.rb b/app/models/principal.rb index 8b46c7ff9..58c3f0497 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class Principal < ActiveRecord::Base - set_table_name 'users' + set_table_name "#{table_name_prefix}users#{table_name_suffix}" has_many :members, :foreign_key => 'user_id', :dependent => :destroy has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"