-
Notifications
You must be signed in to change notification settings - Fork 3
Pm summer 2020 query style #92
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
Conversation
| @list_of_<%= plural_table_name.underscore %> = <%= class_name.singularize %>.all.order({ :created_at => :desc }) | ||
| matching_<%= plural_table_name.underscore %> = <%= class_name.singularize %>.all | ||
| @list_of_<%= plural_table_name.underscore %> = matching_<%= plural_table_name.underscore %>.order({ :created_at => :desc }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't plural_table_name already underscored? I forget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just did a check, plural_table_name does not underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a little inconsistent in draft_generators, but plural_table_name should already be underscored.
plural_table_name is just table_name.pluralize and table_name is underscored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is interesting because when I was testing plural_table_name did not underscore, but it looks like in the docs it does say table_name is joining with "_". I wonder though because we do use plural_table_name throughout the generator with other methods such as .camelize, .humanize and title_case, would the auto underscoring be an issue underscoring for .camelize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jelaniwoods I moved our talk on table_name to a separate issue. With that being moved out, is this ready to ship?
| the_id = params.fetch("path_id") | ||
| @the_<%= singular_table_name.underscore %> = <%= class_name.singularize %>.where({ :id => the_id }).at(0) | ||
|
|
||
| matching_<%= class_name.singularize.downcase %> = <%= class_name.singularize %>.where({ :id => the_id }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should also be plural_table_name, for matching_whatevers?
Same for update, destroy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I cleaned up the plural table names
` the_id = params.fetch("path_id")
matching_rsvp_tables = RsvpTable.where({ :id => the_id })
@the_rsvp_table = matching_rsvp_tables.at(0)
@the_rsvp_table.group_id = params.fetch("query_group_id")`
|
Generated a resource here. LGTM |
|
LGTM! |
in the summer 2020 quarter. This resolves #92
bba55d0 to
671e66b
Compare
in the summer 2020 quarter. This resolves #92
I have edited the query style in the generator of the draft:resource controller. Going along the styling in card #91 I have changed our controller to appear in the same style. Please let me know what you think. In particular, about the spaces for the queries, this is how they appeared in the card, but I can easily remove them.