diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9de0e18d9..6e1c0ce0a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -150,11 +150,6 @@ Rails/HasManyOrHasOneDependent: - 'app/models/workshop.rb' - 'app/models/workshop_invitation.rb' -# Offense count: 1 -Rails/HelperInstanceVariable: - Exclude: - - 'app/helpers/email_helper.rb' - # Offense count: 2 # Configuration parameters: IgnoreScopes. Rails/InverseOf: diff --git a/app/helpers/email_helper.rb b/app/helpers/email_helper.rb deleted file mode 100644 index 549c20d10..000000000 --- a/app/helpers/email_helper.rb +++ /dev/null @@ -1,7 +0,0 @@ -module EmailHelper - private - - def full_url_for(path) - "#{@host}#{path}" - end -end diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb index 0ddac5d73..3a9ec3c44 100644 --- a/app/mailers/contact_mailer.rb +++ b/app/mailers/contact_mailer.rb @@ -2,7 +2,6 @@ class ContactMailer < ApplicationMailer include EmailHeaderHelper helper ApplicationHelper - helper EmailHelper def subscription_notification(contact) @contact = contact diff --git a/app/mailers/event_invitation_mailer.rb b/app/mailers/event_invitation_mailer.rb index 03652d19d..aaf22740f 100644 --- a/app/mailers/event_invitation_mailer.rb +++ b/app/mailers/event_invitation_mailer.rb @@ -40,12 +40,4 @@ def attending(event, member, invitation) mail_to_member(member, subject, &:html) end - - private - - helper do - def full_url_for(path) - "#{@host}#{path}" - end - end end diff --git a/app/mailers/feedback_request_mailer.rb b/app/mailers/feedback_request_mailer.rb index d518406cb..ac77391ab 100644 --- a/app/mailers/feedback_request_mailer.rb +++ b/app/mailers/feedback_request_mailer.rb @@ -12,10 +12,4 @@ def request_feedback(workshops, member, feedback_request) mail_to_member(member, subject, &:html) end - - helper do - def full_url_for(path) - "#{@host}#{path}" - end - end end diff --git a/app/mailers/meeting_invitation_mailer.rb b/app/mailers/meeting_invitation_mailer.rb index 8d97ca7e5..784d0cb25 100644 --- a/app/mailers/meeting_invitation_mailer.rb +++ b/app/mailers/meeting_invitation_mailer.rb @@ -44,12 +44,4 @@ def attendance_reminder(meeting, member) subject = "Reminder: You have a spot for #{@meeting.name} on #{humanize_date(@meeting.date_and_time)}" mail_to_member(@member, subject, &:html) end - - private - - helper do - def full_url_for(path) - "#{@host}#{path}" - end - end end diff --git a/app/mailers/virtual_workshop_invitation_mailer.rb b/app/mailers/virtual_workshop_invitation_mailer.rb index d0cee66a3..3148361af 100644 --- a/app/mailers/virtual_workshop_invitation_mailer.rb +++ b/app/mailers/virtual_workshop_invitation_mailer.rb @@ -1,10 +1,8 @@ class VirtualWorkshopInvitationMailer < ApplicationMailer - include EmailHelper include EmailHeaderHelper include ApplicationHelper helper ApplicationHelper - helper EmailHelper def attending(workshop, member, invitation, waiting_list = false) setup(workshop, invitation, member) diff --git a/app/mailers/workshop_invitation_mailer.rb b/app/mailers/workshop_invitation_mailer.rb index 36390634a..3348b694c 100644 --- a/app/mailers/workshop_invitation_mailer.rb +++ b/app/mailers/workshop_invitation_mailer.rb @@ -1,10 +1,8 @@ class WorkshopInvitationMailer < ApplicationMailer - include EmailHelper include EmailHeaderHelper include ApplicationHelper helper ApplicationHelper - helper EmailHelper def attending(workshop, member, invitation, waiting_list = false) @workshop = WorkshopPresenter.new(workshop) diff --git a/app/views/contact_mailer/subscription_notification.html.haml b/app/views/contact_mailer/subscription_notification.html.haml index 6edd8c800..9e9c54ae8 100644 --- a/app/views/contact_mailer/subscription_notification.html.haml +++ b/app/views/contact_mailer/subscription_notification.html.haml @@ -3,4 +3,4 @@ Hi #{@contact.name}, %p You have been subscribed to codebar's sponsors mailing list. To opt-out follow the link below: %br - =link_to 'Update subscription preferences', full_url_for(contact_preferences_url(token: @contact.token)), class: 'btn' + =link_to 'Update subscription preferences', contact_preferences_url(token: @contact.token), class: 'btn' diff --git a/app/views/event_invitation_mailer/attending.html.haml b/app/views/event_invitation_mailer/attending.html.haml index f90ab6d69..cb78c0531 100644 --- a/app/views/event_invitation_mailer/attending.html.haml +++ b/app/views/event_invitation_mailer/attending.html.haml @@ -28,7 +28,7 @@ #{@event.name} %br %small #{humanize_date(@event.date_and_time, @event.ends_at, with_time: true)} - = link_to 'Update your attendance', full_url_for(event_invitation_url(@event.id, @invitation.token)), class: 'btn' + = link_to 'Update your attendance', event_invitation_url(@event.id, @invitation.token), class: 'btn' .content %table diff --git a/app/views/event_invitation_mailer/invite_coach.html.haml b/app/views/event_invitation_mailer/invite_coach.html.haml index b38fd4200..309b1c05b 100644 --- a/app/views/event_invitation_mailer/invite_coach.html.haml +++ b/app/views/event_invitation_mailer/invite_coach.html.haml @@ -26,7 +26,7 @@ #{@event.name} %p #{humanize_date(@event.date_and_time, @event.ends_at, with_time: true)} - = link_to 'View invitation and RSVP', full_url_for(event_invitation_url(event_id: @event.slug, token: @invitation.token)), class: 'btn' + = link_to 'View invitation and RSVP', event_invitation_url(event_id: @event.slug, token: @invitation.token), class: 'btn' - if @event.venue.present? .content diff --git a/app/views/event_invitation_mailer/invite_student.html.haml b/app/views/event_invitation_mailer/invite_student.html.haml index d26b3782f..f2918ee9a 100644 --- a/app/views/event_invitation_mailer/invite_student.html.haml +++ b/app/views/event_invitation_mailer/invite_student.html.haml @@ -26,7 +26,7 @@ #{@event.name} %p #{humanize_date(@event.date_and_time, @event.ends_at, with_time: true)} - = link_to 'View invitation and RSVP', full_url_for(event_invitation_url(event_id: @event.slug, token: @invitation.token)), class: 'btn' + = link_to 'View invitation and RSVP', event_invitation_url(event_id: @event.slug, token: @invitation.token), class: 'btn' - if @event.venue.present? .content diff --git a/app/views/feedback_request_mailer/request_feedback.html.haml b/app/views/feedback_request_mailer/request_feedback.html.haml index 984ba92b9..7e23ab41a 100644 --- a/app/views/feedback_request_mailer/request_feedback.html.haml +++ b/app/views/feedback_request_mailer/request_feedback.html.haml @@ -31,7 +31,7 @@ %tr %td %p - =link_to "Submit feedback", full_url_for(feedback_url(@feedback_request.token)), class: 'btn' + =link_to "Submit feedback", feedback_url(@feedback_request.token), class: 'btn' .content = render partial: 'shared_mailers/social', locals: { workshop: @workshop } diff --git a/app/views/layouts/email.html.erb b/app/views/layouts/email.html.erb index 539316d02..030366a72 100644 --- a/app/views/layouts/email.html.erb +++ b/app/views/layouts/email.html.erb @@ -17,7 +17,7 @@
Despo
codebar
-

If you dont want to receive these emails <%= link_to "unsubscribe", full_url_for(unsubscribe_url(member_token(@member))), style: "color: #a369d5; text-decoration: underline" %>

+

If you dont want to receive these emails <%= link_to "unsubscribe", unsubscribe_url(member_token(@member)), style: "color: #a369d5; text-decoration: underline" %>

diff --git a/app/views/shared_mailers/_footer.html.haml b/app/views/shared_mailers/_footer.html.haml index 8d600551a..cf3ef83d8 100644 --- a/app/views/shared_mailers/_footer.html.haml +++ b/app/views/shared_mailers/_footer.html.haml @@ -7,6 +7,6 @@ %tr %td{ align: "center" } %p - %a{ href: full_url_for(unsubscribe_url(member_token(@member))) } + %a{ href: unsubscribe_url(member_token(@member)) } %unsubscribe Unsubscribe %td diff --git a/app/views/virtual_workshop_invitation_mailer/attending.html.haml b/app/views/virtual_workshop_invitation_mailer/attending.html.haml index 8dce99e19..39789098e 100644 --- a/app/views/virtual_workshop_invitation_mailer/attending.html.haml +++ b/app/views/virtual_workshop_invitation_mailer/attending.html.haml @@ -34,7 +34,7 @@ %td %h4 %small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'Update or cancel your attendance', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'Update or cancel your attendance', invitation_url(@invitation), class: 'btn' .content %table diff --git a/app/views/virtual_workshop_invitation_mailer/attending_reminder.html.haml b/app/views/virtual_workshop_invitation_mailer/attending_reminder.html.haml index 0c5cead74..e6d716310 100644 --- a/app/views/virtual_workshop_invitation_mailer/attending_reminder.html.haml +++ b/app/views/virtual_workshop_invitation_mailer/attending_reminder.html.haml @@ -30,7 +30,7 @@ %td %h4 %small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'Update or cancel your attendance', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'Update or cancel your attendance', invitation_url(@invitation), class: 'btn' .content %table diff --git a/app/views/virtual_workshop_invitation_mailer/invite_coach.html.haml b/app/views/virtual_workshop_invitation_mailer/invite_coach.html.haml index 4cf0295a7..a3b2a0d58 100644 --- a/app/views/virtual_workshop_invitation_mailer/invite_coach.html.haml +++ b/app/views/virtual_workshop_invitation_mailer/invite_coach.html.haml @@ -38,7 +38,7 @@ =@workshop.to_s %br %small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'View invitation and RSVP', invitation_url(@invitation), class: 'btn' %td{ width: '40%', style: 'vertical-align: top;'} - if @workshop.sponsors.any? %h4 Sponsored by diff --git a/app/views/virtual_workshop_invitation_mailer/invite_student.html.haml b/app/views/virtual_workshop_invitation_mailer/invite_student.html.haml index e7fa34878..45be49a35 100644 --- a/app/views/virtual_workshop_invitation_mailer/invite_student.html.haml +++ b/app/views/virtual_workshop_invitation_mailer/invite_student.html.haml @@ -15,7 +15,7 @@ %p.lead We’re excited to invite you to our next #{@workshop.chapter.name} virtual workshop. %p - As part of our workshops, you’ll get to work through any of our #{link_to 'tutorials', 'http://codebar.github.io/tutorials' } or receive guidance on your personal project. We believe that everyone should be entitled to free learning and our community has #{ link_to 'a lot of devoted developers', full_url_for(coaches_url)} who help out as coaches. + As part of our workshops, you’ll get to work through any of our #{link_to 'tutorials', 'http://codebar.github.io/tutorials' } or receive guidance on your personal project. We believe that everyone should be entitled to free learning and our community has #{ link_to 'a lot of devoted developers', coaches_url} who help out as coaches. %p You will also get the opportunity to interact with other people interested in coding and collaborate with them. %p Please note: We do not accept any RSVPs over email. @@ -29,7 +29,7 @@ =@workshop.to_s %br %small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'View invitation and RSVP', invitation_url(@invitation), class: 'btn' %td{ width: '40%', style: 'vertical-align: top;'} - if @workshop.sponsors.any? %h4 Sponsored by diff --git a/app/views/virtual_workshop_invitation_mailer/waiting_list_reminder.html.haml b/app/views/virtual_workshop_invitation_mailer/waiting_list_reminder.html.haml index 771ee23a7..38d5d14ed 100644 --- a/app/views/virtual_workshop_invitation_mailer/waiting_list_reminder.html.haml +++ b/app/views/virtual_workshop_invitation_mailer/waiting_list_reminder.html.haml @@ -21,7 +21,7 @@ so you should keep keep an eye on your emails during the afternoon on the day of the workshop. %p Alternatively, if you know you can no longer make it, please - = link_to 'remove yourself from the waiting list', full_url_for(invitation_url(@invitation)) + = link_to 'remove yourself from the waiting list', invitation_url(@invitation) so someone else can take part in the workshop. .content @@ -29,7 +29,7 @@ %tr %td %p #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'Update or cancel your attendance', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'Update or cancel your attendance', invitation_url(@invitation), class: 'btn' .content %table diff --git a/app/views/workshop_invitation_mailer/attending.html.haml b/app/views/workshop_invitation_mailer/attending.html.haml index db4f2500e..6f84c9470 100644 --- a/app/views/workshop_invitation_mailer/attending.html.haml +++ b/app/views/workshop_invitation_mailer/attending.html.haml @@ -36,7 +36,7 @@ %h4 Workshop %p #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'Update your attendance', invitation_url(@invitation), class: 'btn' - if @workshop.description.present? %p{ style: 'margin-top: 10px;' } %strong Description: diff --git a/app/views/workshop_invitation_mailer/attending_reminder.html.haml b/app/views/workshop_invitation_mailer/attending_reminder.html.haml index 70e2f4439..5679b2dd1 100644 --- a/app/views/workshop_invitation_mailer/attending_reminder.html.haml +++ b/app/views/workshop_invitation_mailer/attending_reminder.html.haml @@ -31,7 +31,7 @@ Workshop %br %p #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'Update your attendance', invitation_url(@invitation), class: 'btn' - if @workshop.description.present? %p{ style: 'margin-top: 10px;' } %strong Description: diff --git a/app/views/workshop_invitation_mailer/invite_coach.html.haml b/app/views/workshop_invitation_mailer/invite_coach.html.haml index f5f0659d3..a11f53f47 100644 --- a/app/views/workshop_invitation_mailer/invite_coach.html.haml +++ b/app/views/workshop_invitation_mailer/invite_coach.html.haml @@ -37,7 +37,7 @@ Workshop %br %small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'View invitation and RSVP', invitation_url(@invitation), class: 'btn' - if @workshop.description.present? %p{ style: 'margin-top: 15px;' } %strong Description: diff --git a/app/views/workshop_invitation_mailer/invite_student.html.haml b/app/views/workshop_invitation_mailer/invite_student.html.haml index 50f6fe88b..ce2c61216 100644 --- a/app/views/workshop_invitation_mailer/invite_student.html.haml +++ b/app/views/workshop_invitation_mailer/invite_student.html.haml @@ -34,7 +34,7 @@ Workshop %br %small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'View invitation and RSVP', invitation_url(@invitation), class: 'btn' - if @workshop.description.present? %p{ style: 'margin-top: 15px;' } %strong Description: diff --git a/app/views/workshop_invitation_mailer/notify_waiting_list.html.haml b/app/views/workshop_invitation_mailer/notify_waiting_list.html.haml index 91aff5072..b719ca422 100644 --- a/app/views/workshop_invitation_mailer/notify_waiting_list.html.haml +++ b/app/views/workshop_invitation_mailer/notify_waiting_list.html.haml @@ -24,7 +24,7 @@ Workshop %br %p #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'Update your attendance', invitation_url(@invitation), class: 'btn' .content %table diff --git a/app/views/workshop_invitation_mailer/waiting_list_reminder.html.haml b/app/views/workshop_invitation_mailer/waiting_list_reminder.html.haml index 5aa662c9a..6cf1f2724 100644 --- a/app/views/workshop_invitation_mailer/waiting_list_reminder.html.haml +++ b/app/views/workshop_invitation_mailer/waiting_list_reminder.html.haml @@ -20,7 +20,7 @@ %strong Attendees often drop out at short notice, so you should keep an eye on your emails during the afternoon on the day of the workshop. %p Alternatively, if you can no longer make it, you should - = link_to 'remove yourself from the waiting list', full_url_for(invitation_url(@invitation)) + = link_to 'remove yourself from the waiting list', invitation_url(@invitation) so someone else can come to the workshop. .content @@ -31,7 +31,7 @@ Workshop %br %small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)} - = link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn' + = link_to 'Update your attendance', invitation_url(@invitation), class: 'btn' %td{ width: '40%', style: 'vertical-align: top;'} %h4 Venue