Permalink
Browse files

Refactor to reset_table_name

  • Loading branch information...
route committed Jul 28, 2012
1 parent b5dfc47 commit 8f4b54a13f35594ff85c9b6cdfd6edbb5f98acf0
Showing with 4 additions and 8 deletions.
  1. +4 −8 activerecord/lib/active_record/model_schema.rb
@@ -144,16 +144,12 @@ def quoted_table_name
# Computes the table name, (re)sets it internally, and returns it.
def reset_table_name #:nodoc:
- if abstract_class?
- self.table_name = if active_record_super == Base || active_record_super.abstract_class?
- nil
- else
- active_record_super.table_name
- end
+ self.table_name = if abstract_class?
+ active_record_super == Base ? nil : active_record_super.table_name
elsif active_record_super.abstract_class?
- self.table_name = active_record_super.table_name || compute_table_name
+ active_record_super.table_name || compute_table_name
else
- self.table_name = compute_table_name
+ compute_table_name
end
end

0 comments on commit 8f4b54a

Please sign in to comment.