Matthew McGarvey
Matthew McGarvey
Another option would be to raise an error. Transaction specifies that user association will be there but it isn't so something is wrong
I haven't thought this through, but a thought I had was to add methods that return the query object for each of the associations so that they can be overridden....
Looking at this again, there's a query problem, yes, but the real problem seems to be the data integrity. When a user is (soft) deleted, it makes sense that their...
Just writing what I've learned... In order for this to work, you'd have to update the select to include `UPPER(user.email)` and avram doesn't provide a way to model the selections...
Maybe to add another block to it... ```crystal Avram.with_cache do |cache| UserQuery.new.with_cache(cache) do |query| query.email(...) end end ```
With https://github.com/luckyframework/avram/pull/698 merged, some of the points are no longer an issue. I think the main one, though, is supporting different database values. Specifically, support for postgres enums and enums...
Important thing to point out is that this code also allows us to maintain database connections and transactions.
That's a good idea. One issue to figure out is that when you call `UserQuery.new.preload_has_one_assoc` we only issue one sql request for loading all the `has_one_assoc`'s. So if there are...
We have something that might be related already https://github.com/luckyframework/avram/blob/5e29f75371dca5a2bc16858163dc3790cabfbfcb/src/avram/model.cr#L182-L194 It's not used in many situations but it could be a start for something like that
While we don't support Rails' style of polymorphic associations, with being able to specify conditions, you could do it in one way. Take file attachments for example: You could have...