diff options
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index deab56e219..f32857afa3 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2511,6 +2511,13 @@ module ActiveRecord #:nodoc: (id = self.id) ? id.to_s : nil # Be sure to stringify the id for routes end + # Returns the ActiveRecord object when asked for its + # ActiveModel-compliant representation, because ActiveRecord is + # ActiveModel-compliant. + def to_model + self + end + # Returns a cache key that can be used to identify this record. # # ==== Examples |