Sha256: ce1a7e52db6edaaee8910482067545f148e545191033dd045eb309499f3e8fa4

Contents?: true

Size: 678 Bytes

Versions: 12

Compression:

Stored size: 678 Bytes

Contents

module ActiveRecord
  module Reflection
    class AssociationReflection

      alias_method :association_name, :name

      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
      alias_method_chain :klass, :create_polymorphic_class

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hobo-2.2.6 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.2.5 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.2.4 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.2.3 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.2.2 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.2.1 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.2.0 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.1.2 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.1.1 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.1.0 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.1.0.pre4 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.1.0.pre3 lib/hobo/extensions/active_record/associations/reflection.rb