Skip to content

empty belongs_to polymorphic associations in models generation #29

@Xeitor

Description

@Xeitor

Hi there, i noticed that a couple of models from the models autogeneration have this weird empty belongs_to polymorphic association:

belongs_to :"", polymorphic: true

Here it's some debugging info I gathered:

params:

(ruby) full_name
"Musicbrainz::ArtistMeta"
(rdbg) relation
{:pkey=>{"artist_meta_pkey"=>["id"]},
 :cols=>{"id"=>["integer", 32, false, true], "rating"=>["smallint", 16, false, false], "rating_count"=>["integer", 32, false, false]},
 :fks=>
  {"artist_meta_fk_id"=>
    {:is_bt=>true,
     :fk=>"id",
     :assoc_name=>"",
     :inverse_table=>"musicbrainz.artist",
     :inverse=>{:is_bt=>false, :fk=>"id", :assoc_name=>"artist_meta", :alternate_name=>"", :inverse_table=>"musicbrainz.artist_meta", :inverse=>{...}},
     :polymorphic=>true}},
 :schema=>"musicbrainz",
 :class_name=>"Musicbrainz::ArtistMeta",
 :resource=>"artist_meta",
 :rowcount=>267061}
(rdbg) hmts
{}
(rdbg) assoc
{:is_bt=>true,
 :fk=>"id",
 :assoc_name=>"",
 :inverse_table=>"musicbrainz.artist",
 :inverse=>{:is_bt=>false, :fk=>"id", :assoc_name=>"artist_meta", :alternate_name=>"", :inverse_table=>"musicbrainz.artist_meta", :inverse=>{...}},
 :polymorphic=>true}
(ruby) inverse_assoc_name
"musicbrainz.artist_meta"
(ruby) inverse_table
"musicbrainz.artist"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions