class ActiveRecord::Reflection::AssociationReflection

Public Instance Methods

klass_with_create_polymorphic_class() click to toggle source
# File lib/hobo/extensions/active_record/associations/reflection.rb, line 7
def klass_with_create_polymorphic_class
  if options[:polymorphic]
    begin
      klass_without_create_polymorphic_class
    rescue NameError => e
      Object.class_eval "class #{e.missing_name} < ActiveRecord::Base; self.table_name =  '#{active_record.name.tableize}'; def self.hobo_shim?; true; end; end"
      e.missing_name.constantize
    end
  else
    klass_without_create_polymorphic_class
  end
end