mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
7e745f3aa5
commit
ce23862800
2 changed files with 5 additions and 0 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue