diff --git a/app/views/welcome/_cards.html.erb b/app/views/welcome/_cards.html.erb index 8cc8f652a..d579e6e75 100644 --- a/app/views/welcome/_cards.html.erb +++ b/app/views/welcome/_cards.html.erb @@ -1,7 +1,7 @@
#{Faker::Lorem.paragraphs.join('
')}
", diff --git a/db/dev_seeds/polls.rb b/db/dev_seeds/polls.rb index 7d80c2559..188efe4fd 100644 --- a/db/dev_seeds/polls.rb +++ b/db/dev_seeds/polls.rb @@ -31,7 +31,7 @@ section "Creating polls" do end section "Creating Poll Questions & Answers" do - Poll.all.each do |poll| + Poll.find_each do |poll| (1..4).to_a.sample.times do question = Poll::Question.create!(author: User.all.sample, title: Faker::Lorem.sentence(3).truncate(60) + '?', @@ -55,10 +55,10 @@ section "Creating Poll Booths & BoothAssignments" do end section "Creating Poll Shifts for Poll Officers" do - Poll.all.each do |poll| + Poll.find_each do |poll| Poll::BoothAssignment.where(poll: poll).each do |booth_assignment| scrutiny = (poll.ends_at.to_datetime..poll.ends_at.to_datetime + Poll::RECOUNT_DURATION) - Poll::Officer.all.each do |poll_officer| + Poll::Officer.find_each do |poll_officer| { vote_collection: (poll.starts_at.to_datetime..poll.ends_at.to_datetime), recount_scrutiny: scrutiny @@ -130,7 +130,7 @@ section "Creating Poll Voters" do end section "Creating Poll Recounts" do - Poll.all.each do |poll| + Poll.find_each do |poll| poll.booth_assignments.each do |booth_assignment| officer_assignment = poll.officer_assignments.first author = Poll::Officer.first.user @@ -148,7 +148,7 @@ section "Creating Poll Recounts" do end section "Creating Poll Results" do - Poll.all.each do |poll| + Poll.find_each do |poll| poll.booth_assignments.each do |booth_assignment| officer_assignment = poll.officer_assignments.first author = Poll::Officer.first.user diff --git a/lib/tasks/slugs.rake b/lib/tasks/slugs.rake index 2615c5b4c..06de12f00 100644 --- a/lib/tasks/slugs.rake +++ b/lib/tasks/slugs.rake @@ -2,7 +2,7 @@ namespace :slugs do desc "Generate slug attribute for objects from classes that use Sluggable concern" task generate: :environment do %w(Budget Budget::Heading Budget::Group).each do |class_name| - class_name.constantize.all.each(&:generate_slug) + class_name.constantize.find_each(&:generate_slug) end end end diff --git a/spec/features/admin/admin_notifications_spec.rb b/spec/features/admin/admin_notifications_spec.rb index 19f873447..9bea144d4 100644 --- a/spec/features/admin/admin_notifications_spec.rb +++ b/spec/features/admin/admin_notifications_spec.rb @@ -199,7 +199,7 @@ feature "Admin Notifications" do expect(page).to have_content "Notification sent successfully" - User.all.each do |user| + User.find_each do |user| expect(user.notifications.count).to eq(1) end end diff --git a/spec/features/admin/emails/newsletters_spec.rb b/spec/features/admin/emails/newsletters_spec.rb index 3cafcdb17..9371c2f6e 100644 --- a/spec/features/admin/emails/newsletters_spec.rb +++ b/spec/features/admin/emails/newsletters_spec.rb @@ -41,7 +41,7 @@ feature "Admin newsletter emails" do expect(page).to have_css(".newsletter", count: 3) - Newsletter.all.each do |newsletter| + Newsletter.find_each do |newsletter| segment_recipient = I18n.t("admin.segment_recipient.#{newsletter.segment_recipient}") within("#newsletter_#{newsletter.id}") do expect(page).to have_content newsletter.subject diff --git a/spec/features/admin/signature_sheets_spec.rb b/spec/features/admin/signature_sheets_spec.rb index 2417fb176..126e899db 100644 --- a/spec/features/admin/signature_sheets_spec.rb +++ b/spec/features/admin/signature_sheets_spec.rb @@ -15,7 +15,7 @@ feature 'Signature sheets' do expect(page).to have_css(".signature_sheet", count: 3) - SignatureSheet.all.each do |signature_sheet| + SignatureSheet.find_each do |signature_sheet| expect(page).to have_content signature_sheet.name end end diff --git a/spec/features/admin/stats_spec.rb b/spec/features/admin/stats_spec.rb index 60dae016b..48e2513ba 100644 --- a/spec/features/admin/stats_spec.rb +++ b/spec/features/admin/stats_spec.rb @@ -131,7 +131,7 @@ feature 'Stats' do expect(page).to have_css(".proposal_notification", count: 3) - ProposalNotification.all.each do |proposal_notification| + ProposalNotification.find_each do |proposal_notification| expect(page).to have_content proposal_notification.title expect(page).to have_content proposal_notification.body end