diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 15:45:36 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 15:45:36 +0000 |
commit | ce2386280086e8ebb978b16025a778980953c6ea (patch) | |
tree | 98c879690029f627a870bbdd48e645a8d0db023e /activerecord | |
parent | 7e745f3aa5de4e117758ee92e2ca92aa265c6deb (diff) | |
download | rails-ce2386280086e8ebb978b16025a778980953c6ea.tar.gz rails-ce2386280086e8ebb978b16025a778980953c6ea.tar.bz2 rails-ce2386280086e8ebb978b16025a778980953c6ea.zip |
Added alias_method :to_param, :id to Base, such that Active Record objects to be used as URL parameters in Action Pack automatically #812 [Nicholas Seckar/Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@936 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 81e5e97831..594d1dc1e2 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added alias_method :to_param, :id to Base, such that Active Record objects to be used as URL parameters in Action Pack automatically #812 [Nicholas Seckar/Sam Stephenson] + * Improved the performance of the OCI8 adapter for Oracle #723 [pilx/gjenkins] * Added type conversion before saving a record, so string-based values like "10.0" aren't left for the database to convert #820 [dave@cherryville.org] diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index a60741fc21..b945d8d0bc 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -896,6 +896,9 @@ module ActiveRecord #:nodoc: read_attribute(self.class.primary_key) end + # Enables Active Record objects to be used as URL parameters in Action Pack automatically. + alias_method :to_param, :id + def id_before_type_cast #:nodoc: read_attribute_before_type_cast(self.class.primary_key) end |