Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor to reset_table_name

  • Loading branch information...
commit 8f4b54a13f35594ff85c9b6cdfd6edbb5f98acf0 1 parent b5dfc47
@route route authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 activerecord/lib/active_record/model_schema.rb
View
12 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
Please sign in to comment.
Something went wrong with that request. Please try again.