Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
source "https://rubygems.org"

gem "rails", "~> 7.0.2"
gem "sqlite3"
gem "sqlite3", "~> 1.4.0"

gemspec path: "../"
4 changes: 2 additions & 2 deletions lib/webhook_system/base_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module WebhookSystem
class BaseEvent
include PhModel

def initialize(*args, &block)
super(*args, &block)
def initialize(...)
super
@event_id = SecureRandom.uuid.freeze
end

Expand Down
2 changes: 2 additions & 0 deletions lib/webhook_system/encoder.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'base64'

module WebhookSystem

# Class in charge of encoding and decoding encrypted payload
Expand Down
6 changes: 2 additions & 4 deletions lib/webhook_system/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ def topic_names=(new_topics)
new_topics.reject!(&:blank?)
add_topics = new_topics - topic_names

new_topics_attributes = []

topics.each do |topic|
new_topics_attributes << {
new_topics_attributes = topics.map do |topic|
{
id: topic.id,
name: topic.name,
_destroy: new_topics.exclude?(topic.name),
Expand Down
Binary file added test.db-shm
Binary file not shown.
Binary file added test.db-wal
Binary file not shown.