Sha256: 0da868c3dd954baf73b54ea0e4973f81c15a1fb1f873450e48a38aa1f0cae3e9

Contents?: true

Size: 554 Bytes

Versions: 12

Compression:

Stored size: 554 Bytes

Contents

class ActiveRecord::Reflection::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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hobo-1.3.0.pre22 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre21 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre20 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre19 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre18 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre16 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre15 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre14 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre13 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre12 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre11 lib/hobo/extensions/active_record/association_reflection.rb
hobo-1.3.0.pre10 lib/hobo/extensions/active_record/association_reflection.rb