Given I have 2 relations:
class ShiftPositions < ROM::Relation[:sql]
schema(:shift_positions, infer: true) do
associations do
belongs_to :position
belongs_to :pay_type
end
end
def with_position_and_pay_type
combine(:position, :pay_type)
end
end
class Shifts < ROM::Relation[:sql]
schema(:shifts, infer: true) do
associations do
has_many :shift_positions
end
end
def with_shift_positions
combine(shift_positions: %i[position pay_type])
# TODO: how can I use the `with_position_and_pay_type` method here?
end
end
How can I use with_position_and_pay_type
inside with_shift_positions
?