aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-11-29 12:28:04 +0000
committerJon Leighton <j@jonathanleighton.com>2011-11-29 20:13:36 +0000
commit0b72a04d0c93b666c23500aefbe4a6a76593cd36 (patch)
treeade686831d089326d5a45a1cefe084950ed9bd8d /activerecord/CHANGELOG.md
parentf73f53455a01a93bd90cb8c0cee1a7c54afdb301 (diff)
downloadrails-0b72a04d0c93b666c23500aefbe4a6a76593cd36.tar.gz
rails-0b72a04d0c93b666c23500aefbe4a6a76593cd36.tar.bz2
rails-0b72a04d0c93b666c23500aefbe4a6a76593cd36.zip
Deprecate set_table_name in favour of self.table_name= or defining your own method.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 6fbcfb4c14..2d15b04334 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,5 +1,21 @@
## Rails 3.2.0 (unreleased) ##
+* Deprecated `set_table_name`. Use `self.table_name=` instead, or define your own
+ `self.table_name` method:
+
+ class Project < ActiveRecord::Base
+ self.table_name = "project"
+ end
+
+ class Post < ActiveRecord::Base
+ def self.table_name
+ "special_" + super
+ end
+ end
+ Post.table_name # => "special_posts"
+
+ *Jon Leighton*
+
* Generated association methods are created within a separate module to allow overriding and
composition using `super`. For a class named `MyModel`, the module is named
`MyModel::GeneratedFeatureMethods`. It is included into the model class immediately after