diff options
author | Takehiro Adachi <takehiro0740@gmail.com> | 2015-01-21 18:33:32 +0900 |
---|---|---|
committer | Takehiro Adachi <takehiro0740@gmail.com> | 2015-01-27 16:01:34 +0900 |
commit | 3729103e17e00494c8eae76e8a4ee1ac990d3450 (patch) | |
tree | 731c16a52d5c698ec4f7955064959218dc3857d0 /activerecord/lib/active_record | |
parent | fc36841dbb85652fed450e0ba8f2569b7ce59bcf (diff) | |
download | rails-3729103e17e00494c8eae76e8a4ee1ac990d3450.tar.gz rails-3729103e17e00494c8eae76e8a4ee1ac990d3450.tar.bz2 rails-3729103e17e00494c8eae76e8a4ee1ac990d3450.zip |
Update model_schema.rb [ci skip]
Overriding these methods may cause unexpected results since
"table_name=" does more then just setting the "@table_name".
ref: https://github.com/rails/rails/pull/18622#issuecomment-70874358
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/model_schema.rb | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb index 641512d323..a8f326a218 100644 --- a/activerecord/lib/active_record/model_schema.rb +++ b/activerecord/lib/active_record/model_schema.rb @@ -105,23 +105,6 @@ module ActiveRecord # +table_name_suffix+ is appended. So if you have "myapp_" as a prefix, # the table name guess for an Invoice class becomes "myapp_invoices". # Invoice::Lineitem becomes "myapp_invoice_lineitems". - # - # You can also set your own table name explicitly: - # - # class Mouse < ActiveRecord::Base - # self.table_name = "mice" - # end - # - # Alternatively, you can override the table_name method to define your - # own computation. (Possibly using <tt>super</tt> to manipulate the default - # table name.) Example: - # - # class Post < ActiveRecord::Base - # def self.table_name - # "special_" + super - # end - # end - # Post.table_name # => "special_posts" def table_name reset_table_name unless defined?(@table_name) @table_name @@ -132,9 +115,6 @@ module ActiveRecord # class Project < ActiveRecord::Base # self.table_name = "project" # end - # - # You can also just define your own <tt>self.table_name</tt> method; see - # the documentation for ActiveRecord::Base#table_name. def table_name=(value) value = value && value.to_s |