Sha256: 6feebd7d761585367134c6c5d73630cceb3672f7b16b7c467910139c4fb7b9b0

Contents?: true

Size: 642 Bytes

Versions: 11

Compression:

Stored size: 642 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; set_table_name '#{active_record.name.tableize}'; 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

11 entries across 11 versions & 1 rubygems

Version Path
hobo-1.3.0.RC2 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.RC1 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.RC lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre31 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre29 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre28 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre27 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre26 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre25 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre24 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.0.pre23 lib/hobo/extensions/active_record/associations/reflection.rb