I have 1:N relation where parent table LOCATIONS contains fields server_id and location_id and table DEVICES is related to the LOCATIONS throught fields server_id and location_id.
How can I establish the HasMany() and BelongsTo() between this two tables?