You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defining an associaton gives me a finalize_associations!' exception, so I guess it's not implemented. I need to combine a http relation with a sql relation. Am I not mistaking that the only option I have is to use combine_with?
The text was updated successfully, but these errors were encountered:
Thanks for response!
Okay. Now here's the tricky part. Suppose I have an http relation:
class UsersRelation < ::ROM::Relation[:http]
gateway :my_awesome_gateway
schema(:users) do
attribute :id, Types::Int
attribute :login, Types::Strict::String
attribute :car_id, Types::Int
primary_key :id
end
def by_id(id)
with_path(id.to_s)
end
end
And an sql relation:
class CarsRelation < ::ROM::Relation[:sql]
gateway :my_precious_gateway
schema(:cars, infer: true)
dataset do
where(is_deleted: 0).order(:id)
end
def by_id(id)
where(id: id)
end
def for_users(_assoc, users)
where(id: users.map { |u| u[:car_id] })
end
end
So when I use users.by_id(id).combine_with(cars.for_users).one it throws
ROM::MapperMisconfiguredError ([[:id], [:name], [:create_date], [:change_date], [:description]] attribute: block is required for :from with union value.):
where above-mentioned attributes are the attributes of an entity, representing a car in a database. Where should I look for the problem? I've read a lot of comments in gitter with the same problem, and I believe that the code should work.
Defining an associaton gives me a
finalize_associations!'
exception, so I guess it's not implemented. I need to combine a http relation with a sql relation. Am I not mistaking that the only option I have is to usecombine_with
?The text was updated successfully, but these errors were encountered: