{"action":"created","issue":{"url":"https://api.github.com/repos/javalite/activejdbc/issues/676","repository_url":"https://api.github.com/repos/javalite/activejdbc","labels_url":"https://api.github.com/repos/javalite/activejdbc/issues/676/labels{/name}","comments_url":"https://api.github.com/repos/javalite/activejdbc/issues/676/comments","events_url":"https://api.github.com/repos/javalite/activejdbc/issues/676/events","html_url":"https://github.com/javalite/activejdbc/issues/676","id":299341757,"number":676,"title":"Make @Many2Many repeatable","user":{"login":"cschabl","id":3714001,"avatar_url":"https://avatars2.githubusercontent.com/u/3714001?v=4","gravatar_id":"","url":"https://api.github.com/users/cschabl","html_url":"https://github.com/cschabl","followers_url":"https://api.github.com/users/cschabl/followers","following_url":"https://api.github.com/users/cschabl/following{/other_user}","gists_url":"https://api.github.com/users/cschabl/gists{/gist_id}","starred_url":"https://api.github.com/users/cschabl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cschabl/subscriptions","organizations_url":"https://api.github.com/users/cschabl/orgs","repos_url":"https://api.github.com/users/cschabl/repos","events_url":"https://api.github.com/users/cschabl/events{/privacy}","received_events_url":"https://api.github.com/users/cschabl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-02-22T12:50:57Z","updated_at":"2018-02-27T14:31:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"`@Many2Many` can be either added to the parent or the child model. If the parent has more than one such association `@Many2Many` can be placed on the child model. If you prefer to place `@Many2Many` according to the navigation path in the application or if a child model is associated with more than one parent in such a way, it should be possible to place more than one `@Many2Many` on a model class. For this, `@Repeatable` could be added to `@Many2Many` or an explicit container annotation could be introduced."},"comment":{"url":"https://api.github.com/repos/javalite/activejdbc/issues/comments/368896666","html_url":"https://github.com/javalite/activejdbc/issues/676#issuecomment-368896666","issue_url":"https://api.github.com/repos/javalite/activejdbc/issues/676","id":368896666,"user":{"login":"mppfiles","id":830172,"avatar_url":"https://avatars2.githubusercontent.com/u/830172?v=4","gravatar_id":"","url":"https://api.github.com/users/mppfiles","html_url":"https://github.com/mppfiles","followers_url":"https://api.github.com/users/mppfiles/followers","following_url":"https://api.github.com/users/mppfiles/following{/other_user}","gists_url":"https://api.github.com/users/mppfiles/gists{/gist_id}","starred_url":"https://api.github.com/users/mppfiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppfiles/subscriptions","organizations_url":"https://api.github.com/users/mppfiles/orgs","repos_url":"https://api.github.com/users/mppfiles/repos","events_url":"https://api.github.com/users/mppfiles/events{/privacy}","received_events_url":"https://api.github.com/users/mppfiles/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T14:31:56Z","updated_at":"2018-02-27T14:31:56Z","author_association":"NONE","body":"The active record doc does not state it, because it just describe the simplest use case for a many to many relation (just one), using [has_many :through](http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association)\r\nBut there is no restriction like \"each model can define just one many to many\", as stated in several examples like [this one](https://stackoverflow.com/a/2383560/692947). Something like:\r\n\r\n```ruby\r\nclass Physician < ApplicationRecord\r\n  has_many :appointments\r\n  has_many :patients, through: :appointments     # many-to-many 1\r\n  has_many :clinics, through: :doctors_clinics   # many-to-many 2 ... etc...\r\nend\r\n\r\n"}}
{"actor":{"display_login":"mppfiles"}}