diff options
author | Dmitry Vorotilin <d.vorotilin@gmail.com> | 2012-07-28 18:55:41 +0400 |
---|---|---|
committer | Dmitry Vorotilin <d.vorotilin@gmail.com> | 2012-07-28 18:55:41 +0400 |
commit | 8f4b54a13f35594ff85c9b6cdfd6edbb5f98acf0 (patch) | |
tree | 952bbc3201e22c63f4b612719728be36f1cac5fe /activerecord/lib | |
parent | b5dfc4715030dfeaf3e66af4653cb9e2b9f1da70 (diff) | |
download | rails-8f4b54a13f35594ff85c9b6cdfd6edbb5f98acf0.tar.gz rails-8f4b54a13f35594ff85c9b6cdfd6edbb5f98acf0.tar.bz2 rails-8f4b54a13f35594ff85c9b6cdfd6edbb5f98acf0.zip |
Refactor to reset_table_name
Diffstat (limited to 'activerecord/lib')
-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 |