-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: how to create list of entities #114
Comments
Hey, glad to hear that surrealist is actually used outside of rails! |
Why not use a redefined method?
|
hey, good question. My answer: I want to use specific schema for each item in the list and have a ability easy change it. Something like this json_schema do
{
id: String,
title: String,
products: Array(title: String, body: String, id: Integer)
}
end or json_schema do
{
id: String,
title: String,
products: Array(Product.json_schema)
}
end |
you can try
I just don't like to use values in json_schema to invoke something, i think it is better to use keys to invoke methods |
@kolasss I see your point, but I don't think it will hurt to have such a feature, it doesn't break anything or require any changes in the core of the library. |
Hey,
I use surrealist for json schema in my presenters and I found interesting problem. I use hanami entioty for building data objects and I have no idea how to use
Surrealist.surrealize_collection
with it (and can I use it?).Also, I want to use list of objects and I have no idea how to do it without Dry-Types. I thought that I can do something like this:
where
Entities::User
is surrealist schema for entity object. WDYT can we update documentation for this cases?The text was updated successfully, but these errors were encountered: