Skip to content
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

Fix typo in "reccomend_textbook" #41

Open
nathanmsmith opened this issue Dec 21, 2022 · 14 comments
Open

Fix typo in "reccomend_textbook" #41

nathanmsmith opened this issue Dec 21, 2022 · 14 comments

Comments

@nathanmsmith
Copy link
Member

The Review model has a reccomend_textbook (sic) column. Let's add a migration to fix that typo!

@nathanmsmith nathanmsmith added the good first issue Good for newcomers label Dec 21, 2022
@briannarenni
Copy link

Hi, I'm looking for a good first issue to use as a first time contribution! Is this the only file that needs the typo fix, or does the typo appear in other places?

Only asking since I've never worked with Ruby (I stumbled on this from the HTML tag) and this seems like a simple typo issue not needing build.

@nathanmsmith
Copy link
Member Author

Hey @briannarenni! We'd want to update every file where this occurs:

test/factories.rb
99:    reccomend_textbook { false }

test/system/reviews_system_test.rb
91:    assert review.reccomend_textbook
165:    assert review.reccomend_textbook

test/models/review_test.rb
101:                     reccomend_textbook: false)
121:            label: :reccomend_textbook,

test/helpers/course_helper_test.rb
138:    describe "reccomend_textbook" do
141:          label: :reccomend_textbook,
149:          label: :reccomend_textbook,
157:          label: :reccomend_textbook,

app/controllers/reviews_controller.rb
117:        reccomend_textbook: review_params.textbook,

app/helpers/course_helper.rb
112:    when :reccomend_textbook
150:    when :reccomend_textbook

app/models/review.rb
70:    textbook_reccomendations = reviews.where.not(reccomend_textbook: nil)
71:                                      .group(:reccomend_textbook).count
102:                     label: :reccomend_textbook,
212:        label: :reccomend_textbook,
213:        value: reccomend_textbook,

We also need to update the database column, to do that we'll need to use a Rails migration using the rename_column function. You can see an example here. Read through the migration guide and let me know if you're still interested! No worries if not too :)

@briannarenni
Copy link

Hey @briannarenni! We'd want to update every file where this occurs:

test/factories.rb
99:    reccomend_textbook { false }

test/system/reviews_system_test.rb
91:    assert review.reccomend_textbook
165:    assert review.reccomend_textbook

test/models/review_test.rb
101:                     reccomend_textbook: false)
121:            label: :reccomend_textbook,

test/helpers/course_helper_test.rb
138:    describe "reccomend_textbook" do
141:          label: :reccomend_textbook,
149:          label: :reccomend_textbook,
157:          label: :reccomend_textbook,

app/controllers/reviews_controller.rb
117:        reccomend_textbook: review_params.textbook,

app/helpers/course_helper.rb
112:    when :reccomend_textbook
150:    when :reccomend_textbook

app/models/review.rb
70:    textbook_reccomendations = reviews.where.not(reccomend_textbook: nil)
71:                                      .group(:reccomend_textbook).count
102:                     label: :reccomend_textbook,
212:        label: :reccomend_textbook,
213:        value: reccomend_textbook,

We also need to update the database column, to do that we'll need to use a Rails migration using the rename_column function. You can see an example here. Read through the migration guide and let me know if you're still interested! No worries if not too :)

Alright, I'm working on something for at most another hour and I should be done. I'll give it a read through and let you know!

@briannarenni
Copy link

I'm going to fork it and try this out, I think I've got it down just for the column name change. If I create a migration file in my fork without running it, you'll be able to review it first with no affect to the DB right? I'll go ahead and try it out.

@nathanmsmith
Copy link
Member Author

Yes, you can just create the migration file! I'm happy to review and test it.

@briannarenni
Copy link

Oh great timing, I think the only thing I'm not totally sure of is this in your example:
rename_column(:sections, :instructors, :registrar_instructors)
Is this change in the same sections table?

@nathanmsmith
Copy link
Member Author

Good question! No, it's actually on the reviews table!

@briannarenni
Copy link

Alright, I made the fork so I should have a PR in the next few minutes then! I love trying new things, I just want to make sure I don't nuke a table haha.

@briannarenni
Copy link

Agh. Unfortunately I have Ruby installed, but am running into an issue with my PATH and the pre-installed older version on my Mac. I'm going to spend some time trying to fix it but for times sake, I won't be able to work on the PR. If I can get it using the correct version tomorrow I'll let you know though if no one else has done this issue.

@TimothyGu
Copy link
Member

Hi @briannarenni, has there been any progress on this issue?

@briannarenni
Copy link

Hi @briannarenni, has there been any progress on this issue?

I couldn't get Ruby to work, I ended up finding issues in my shell and fixing them that night. I meant to comment and release this to someone else but it slipped my mind, apologies for that.

@subashravichandran
Copy link

Hi, I'd like to work on this issue.

@Shweta-Tapele
Copy link

Hello, I would like to try this out and would be my first contribution.

@nathanmsmith nathanmsmith removed the good first issue Good for newcomers label Aug 20, 2023
@nathanmsmith
Copy link
Member Author

sorry, I currently don't have the time to review contributions for outside contributors! Will remove the good first issue tage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants