I don’t think this is possible, but thought I’d pose the question (I did see this, which is similar but specifically asking if the relationships DSL somehow makes it easier to implement).
Is it possible to create a many to many relationship with an attribute, e.g., along these lines:
relationships do
many_to_many :members App.Accounts.User do
through App.Team.Members
source_attribute_on_join_resource :team_id
destination_attribute_on_join_resource :user_id
> attribute :role, :atom do # this bit... can't be done?
> allow_nil? false
> constraints [one_of: [:team_member, :team_lead]]
> end
end
end
From what I can see in the relationships DSL adding attributes like this isn’t supported. I can see how that could get difficult.
On the other hand – having very simple support would be awesome, e.g., in this case I just want a :role identifier that must be set. No magic and no tricky other stuff. It could potentially save a good bit of overhead (defining a new property, etc., etc.)
Is this worth writing up as a feature request?






















