Skip to content

Commit f0c2f8e

Browse files
committed
chore: Namespace a class to avoid Zeitwerk error
Zeitwerk is the code loader in Rails. It expects files to define classes by a convention that it explains very clearly: Zeitwerk::NameError: expected file /home/runner/work/planner/planner/lib/services/event_calendar.rb to define constant Services::EventCalendar, but didn't
1 parent 83606c4 commit f0c2f8e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/mailers/event_invitation_mailer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def attending(event, member, invitation)
3434

3535
require 'services/event_calendar'
3636
attachments['codebar.ics'] = { mime_type: 'text/calendar',
37-
content: EventCalendar.new(@event).calendar.to_ical }
37+
content: ServicesEventCalendar.new(@event).calendar.to_ical }
3838

3939
subject = "Your spot to #{@event.name} has been confirmed."
4040

lib/services/event_calendar.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class EventCalendar
1+
class Services::EventCalendar
22
attr_reader :event
33

44
def initialize(event)

0 commit comments

Comments
 (0)