diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 5e61d26b79..ab9b5d6221 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -552,7 +552,13 @@ module ActiveRecord #:nodoc: # set_table_name "mice" # end def table_name - "#{table_name_prefix}#{undecorated_table_name(class_name_of_active_record_descendant(self))}#{table_name_suffix}" + reset_table_name + end + + def reset_table_name + name = "#{table_name_prefix}#{undecorated_table_name(class_name_of_active_record_descendant(self))}#{table_name_suffix}" + set_table_name name + name end # Defines the primary key field -- can be overridden in subclasses. Overwriting will negate any effect of the |