With "standard" string type, rails takes care of assigning the correct type to the new element:
class Animal < ActiveRecord::Base
has_many :source_links, , :as => :source
end
class Link < ActiveRecord::Base
belongs_to :source, :polymorphic => true
end
a = Animal.create
a.source_links << Link.new
a.first.source_type
=> 'Animal'
With "standard" string type, rails takes care of assigning the correct type to the new element: