aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-02-03 13:27:23 +0100
committerYves Senn <yves.senn@gmail.com>2014-02-03 13:38:14 +0100
commitb7c7cb1a6379f861c04a1273c67fa8b46212f527 (patch)
treed779ee452358e46750ab62a082efe0d23cfec797 /activerecord/lib/active_record/associations.rb
parentc46b0d1023490bdbfac6b0db6426b3bf8075ebeb (diff)
downloadrails-b7c7cb1a6379f861c04a1273c67fa8b46212f527.tar.gz
rails-b7c7cb1a6379f861c04a1273c67fa8b46212f527.tar.bz2
rails-b7c7cb1a6379f861c04a1273c67fa8b46212f527.zip
docs, revisit polymorphic associations with STI example. [ci skip]
This is a follow up to #13926. /cc @fxn
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rw-r--r--activerecord/lib/active_record/associations.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 051f7dff53..918806e8b4 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -669,11 +669,14 @@ module ActiveRecord
# and member posts that use the posts table for STI. In this case, there must be a +type+
# column in the posts table.
#
+ # Note: The <tt>attachable_type=</tt> method is being called when assigning an +attachable+.
+ # The +class_name+ of the +attachable+ is being passed as a String.
+ #
# class Asset < ActiveRecord::Base
# belongs_to :attachable, polymorphic: true
#
- # def attachable_type=(klass)
- # super(klass.to_s.classify.constantize.base_class.to_s)
+ # def attachable_type=(class_name)
+ # super(class_name.constantize.base_class.to_s)
# end
# end
#