Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rescheduled 🗓️
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
c3lingo
rescheduled 🗓️
Commits
17ca9037
Commit
17ca9037
authored
2 months ago
by
Teal Bauer
Browse files
Options
Downloads
Patches
Plain Diff
fix: make handle_speaker_event public again
parent
6f56cc2d
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#39527
passed
2 months ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/subscribers/notifications_subscriber.rb
+35
-35
35 additions, 35 deletions
app/subscribers/notifications_subscriber.rb
with
35 additions
and
35 deletions
app/subscribers/notifications_subscriber.rb
+
35
−
35
View file @
17ca9037
...
@@ -101,41 +101,6 @@ class NotificationsSubscriber
...
@@ -101,41 +101,6 @@ class NotificationsSubscriber
Rails
.
logger
.
error
(
e
.
backtrace
.
join
(
"
\n
"
))
Rails
.
logger
.
error
(
e
.
backtrace
.
join
(
"
\n
"
))
end
end
private
def
generate_notification_message
(
record
,
changes
)
return
""
unless
record
&
.
respond_to?
(
:title
)
&&
record
&
.
respond_to?
(
:conference
)
title
=
record
.
title
||
"Untitled"
# Generate URL for the record
url
=
begin
case
record
when
Session
conference_session_url
(
record
.
conference
,
record
,
host:
"rescheduled.c3lingo.org"
,
protocol:
"https"
)
else
"https://rescheduled.c3lingo.org"
end
rescue
=>
e
Rails
.
logger
.
error
(
"Failed to generate URL:
#{
e
.
message
}
"
)
"https://rescheduled.c3lingo.org"
end
# Format changes safely
change_text
=
changes
&
.
map
do
|
attr
,
change_array
|
next
unless
change_array
.
is_a?
(
Array
)
&&
change_array
.
length
>=
2
from
,
to
=
change_array
"-
#{
attr
}
:
#{
from
}
→
#{
to
}
"
end
&
.
compact
&
.
join
(
"
\n
"
)
||
"No changes recorded"
"<b><a href=
\"
#{
url
}
\"
>
#{
record
.
class
.
name
}
:
#{
title
}
</a></b>
\n
<b>updated</b>
\n
#{
change_text
}
"
end
def
handle_speaker_event
(
event
)
def
handle_speaker_event
(
event
)
Rails
.
logger
.
info
(
"NotificationsSubscriber: Speaker event
#{
event
.
inspect
}
"
)
Rails
.
logger
.
info
(
"NotificationsSubscriber: Speaker event
#{
event
.
inspect
}
"
)
model_name
,
action
=
event
.
name
.
split
(
"."
)
model_name
,
action
=
event
.
name
.
split
(
"."
)
...
@@ -178,4 +143,39 @@ class NotificationsSubscriber
...
@@ -178,4 +143,39 @@ class NotificationsSubscriber
end
end
end
end
end
end
private
def
generate_notification_message
(
record
,
changes
)
return
""
unless
record
&
.
respond_to?
(
:title
)
&&
record
&
.
respond_to?
(
:conference
)
title
=
record
.
title
||
"Untitled"
# Generate URL for the record
url
=
begin
case
record
when
Session
conference_session_url
(
record
.
conference
,
record
,
host:
"rescheduled.c3lingo.org"
,
protocol:
"https"
)
else
"https://rescheduled.c3lingo.org"
end
rescue
=>
e
Rails
.
logger
.
error
(
"Failed to generate URL:
#{
e
.
message
}
"
)
"https://rescheduled.c3lingo.org"
end
# Format changes safely
change_text
=
changes
&
.
map
do
|
attr
,
change_array
|
next
unless
change_array
.
is_a?
(
Array
)
&&
change_array
.
length
>=
2
from
,
to
=
change_array
"-
#{
attr
}
:
#{
from
}
→
#{
to
}
"
end
&
.
compact
&
.
join
(
"
\n
"
)
||
"No changes recorded"
"<b><a href=
\"
#{
url
}
\"
>
#{
record
.
class
.
name
}
:
#{
title
}
</a></b>
\n
<b>updated</b>
\n
#{
change_text
}
"
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment