Polymorphic Search
I have a basic model structure like this:
class History < ActiveRecord::Base
belongs_to :historical, polymorphic: true, touch: true
end
with several related models:
has_many :history, :as => :historical, :dependent => :destroy
It seem to me that there is no easy way to search the History model AND the related models. For example each related model has a name
and notes
field. Can I do some sort of crazy multiple join and use conditions on the join?