Sha256: dacbb43574096ca265c34206ab1c26f2daa315af571f974023e33645a92692e8

Contents?: true

Size: 674 Bytes

Versions: 27

Compression:

Stored size: 674 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}'; 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

27 entries across 27 versions & 1 rubygems

Version Path
hobo-2.1.0.pre2 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.1.0.pre1 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.1 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre10 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre9 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre8 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.3 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre7 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre6 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre5 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre4 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.2 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.3.1 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre3 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre2 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-2.0.0.pre1 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.4.0.pre8 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.4.0.pre7 lib/hobo/extensions/active_record/associations/reflection.rb
hobo-1.4.0.pre6 lib/hobo/extensions/active_record/associations/reflection.rb