I’m going through the second video in Intermediate Rails, and I’m not sure I understand how you got polymorphic associations working with only defining one side of the relationship. All of the examples I’ve seen (section 2.9 of http://guides.rubyonrails.org/association_basics.html for example), have you set it up on both sides of the association using the :as option.
class Picture < ActiveRecord::Base belongs_to :imageable, polymorphic: true end class Employee < ActiveRecord::Base has_many :pictures, as: :imageable end class Product < ActiveRecord::Base has_many :pictures, as: :imageable end
However in Shouter it ended up like this:
class Shout < ActiveRecord::Base belongs_to :content, polymorphic: true end class PhotoShout < ActiveRecord::Base end class TextShout < ActiveRecord::Base end
Do you not have to set up the has_one/has_many on the other side of the relationship if you don’t want to access it from that side?