Replies: 1 comment
-
I agree. I was definitely a little fuzzy on what belonged in the
controller and what belonged in the model.
…On Wed, Jun 15, 2022 at 5:44 PM andrew nimmo ***@***.***> wrote:
I'm realizing there are a lot of query methods in some older controllers
(as i'm reading through NameController). They're important for building
views, but often are (or could be) separated from controller code.
Since GraphQL does not have access to controller methods, but does have
access to model methods, and these queries may be useful in the new
interface, I'd like to start a refactor to move these to the models.
For an example, see NameController #needed_descriptions
<https://github.com/MushroomObserver/mushroom-observer/blob/6f1e5ccb2b1c330dbe729ab65ff27c4dfee9a8f4/app/controllers/name_controller.rb#L165>
#show_name
<https://github.com/MushroomObserver/mushroom-observer/blob/6f1e5ccb2b1c330dbe729ab65ff27c4dfee9a8f4/app/controllers/name_controller.rb#L355>
What do you all think?
—
Reply to this email directly, view it on GitHub
<#1024>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYTNNK6ISCFWTOKZADH4PTVPJFFJANCNFSM5Y4XZBNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm realizing there are a lot of query methods in some older controllers (as i'm reading through
NameController
). They're important for building views, but often are (or could be) separated from controller code.Since GraphQL does not have access to controller methods, but does have access to model methods, and these queries may be useful in the new interface, I'd like to start a refactor to move these to the models.
For an example, see
NameController
#needed_descriptions
#show_name
What do you all think?
Beta Was this translation helpful? Give feedback.
All reactions