Has_many_polymorphs - specifying the names of the 'children'

I have a class called MusicService which can have various things
‘shared’ with it, so i’m setting up a has_many_polymorphs like this:

has_many_polymorphs :shared_content, :from => [:resources, :lessons,
:courses], :through => :sharings

However, this will generate some associations like this:

=> resources shared with that music service.

However, i don’t want that association as it already exists and has a
different meaning (‘resources created by that music service’). So, i
want the polymorphic associations to be called


Similarly, i want to refer to the music services that have been linked
through sharings as ‘allowed_music_services’, so


I’m sure this is simple but i can’t work it out, can anyone help please?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs