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
{{ message }}
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
Hi guys! I apologize in advance if this is out of place (feel free to close this issue if that's the case) but I do have some questions about Clean Architecture and the way it's implemented here.
I am personally trying to wrap my head around Clean Architecture, and while it sounds great in theory, taking it to practice is quite hard.
My first question is, is it a demo app somewhere I can see? :)
My other question is about scopes. What I understand to be the goal of CA (or at least one of it's goals) is to move the domain logic to it's own place, independent of Rails, Sinatra, the CLI or whatever you use to deliver your app.
That sounds great and all, but I found ActiveRecord to be so closely tied to Rails-land that it's really hard to abstract it away. Particularly for reading complex data/queries.
For example, one blocker I have are scopes. To define scopes (say, Admins can see all Post entities but Users can see only those where(published: true)) you need to a way to filter the results from the database (ActiveRecord::Relation most likely) on the domain-side somehow.
Is there a way to use scopes with this implementation? For example, implementing a use case FindHotStories where it returns the last 10 hot stories where publish is true if you are a regular user, and just all the stories if you are an admin.
Thanks for your time 😄
Cheers!
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi guys! I apologize in advance if this is out of place (feel free to close this issue if that's the case) but I do have some questions about Clean Architecture and the way it's implemented here.
I am personally trying to wrap my head around Clean Architecture, and while it sounds great in theory, taking it to practice is quite hard.
My first question is, is it a demo app somewhere I can see? :)
My other question is about scopes. What I understand to be the goal of CA (or at least one of it's goals) is to move the domain logic to it's own place, independent of Rails, Sinatra, the CLI or whatever you use to deliver your app.
That sounds great and all, but I found ActiveRecord to be so closely tied to Rails-land that it's really hard to abstract it away. Particularly for reading complex data/queries.
For example, one blocker I have are scopes. To define scopes (say, Admins can see all
Post
entities but Users can see only thosewhere(published: true)
) you need to a way to filter the results from the database (ActiveRecord::Relation
most likely) on the domain-side somehow.Is there a way to use scopes with this implementation? For example, implementing a use case
FindHotStories
where it returns the last 10 hot stories wherepublish
is true if you are a regular user, and just all the stories if you are an admin.Thanks for your time 😄
Cheers!
The text was updated successfully, but these errors were encountered: