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

Issue 5844: Seeder other duties #5903

Merged
merged 7 commits into from
Jul 13, 2024
Merged

Issue 5844: Seeder other duties #5903

merged 7 commits into from
Jul 13, 2024

Conversation

gaurijo
Copy link
Collaborator

@gaurijo gaurijo commented Jul 9, 2024

What github issue is this PR for, if any?

Resolves 5844

What changed, and why?

  • @create_other_duties_counter attr. initialized equal to 0
  • a private method, create_other_duties was created; iterates through each Volunteer object and creates 2 OtherDuty instances per volunteer
  • each time other_duty is created it, is incremented onto the counter (+= 1)
  • prints how many other duties have been created by string interpolating the final counter

How is this tested? (please write tests!) 💖💪

Issue does not require tests;

Tested locally in Rails Console using Volunteer and OtherDuty objects + Faker for dummy data.

Screenshots please :)

From the console:

Screenshot 2024-07-08 at 8 46 40 PM Screenshot 2024-07-08 at 7 36 43 PM

Feelings gif (optional)

_What gif best describes your feeling working on this issue? https://giphy.com/

gina linetti

@github-actions github-actions bot added the ruby Pull requests that update Ruby code label Jul 9, 2024
Copy link
Collaborator

@elasticspoon elasticspoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! A small request to make it more similar to some of our other seeders.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add other_duties to

def active_record_classes
to show a count of the number created.

Comment on lines 123 to 126
@other_duties_counter = + 1
}
end
puts "Created #{@other_duties_counter} Other Duties."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add the count to the main seeds.rb file we don't need the puts or the counter.

Copy link
Collaborator

@elasticspoon elasticspoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you ❤️

@elasticspoon elasticspoon merged commit 04036e9 into main Jul 13, 2024
18 checks passed
@elasticspoon elasticspoon deleted the seeder_other_duties branch July 13, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Other Duties to the Seeder
2 participants