diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-07-28 09:18:38 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-07-28 09:18:38 -0700 |
commit | ab0359c4ae7049eb8262c212c520cb8966e7392c (patch) | |
tree | 954149ff4f21b9c84c10786dda155824ca08b35b | |
parent | 0cda0b3dbac13c9b60bbe508b130b9cb8a5071dd (diff) | |
parent | 8f4b54a13f35594ff85c9b6cdfd6edbb5f98acf0 (diff) | |
download | rails-ab0359c4ae7049eb8262c212c520cb8966e7392c.tar.gz rails-ab0359c4ae7049eb8262c212c520cb8966e7392c.tar.bz2 rails-ab0359c4ae7049eb8262c212c520cb8966e7392c.zip |
Merge pull request #7185 from route/reset_table_name_refactoring
Refactor to reset_table_name
-rw-r--r-- | activerecord/lib/active_record/model_schema.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb index e6b76ddc4c..9981a9a804 100644 --- a/activerecord/lib/active_record/model_schema.rb +++ b/activerecord/lib/active_record/model_schema.rb @@ -144,16 +144,12 @@ module ActiveRecord # 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 |