Skip to content

Commit

Permalink
Update test coverage with #179
Browse files Browse the repository at this point in the history
  • Loading branch information
simukappu committed Jul 23, 2024
1 parent 7709400 commit 3f47fab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/activity_notification/orm/active_record/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ class Notification < ::ActiveRecord::Base
belongs_to :notifier, polymorphic: true, optional: true

# Serialize parameters Hash
# :nocov:
if Rails.gem_version >= Gem::Version.new('7.1')
serialize :parameters, type: Hash, coder: YAML
else
serialize :parameters, Hash
end
# :nocov:

validates :target, presence: true
validates :notifiable, presence: true
Expand Down
2 changes: 2 additions & 0 deletions lib/activity_notification/orm/active_record/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ class Subscription < ::ActiveRecord::Base
belongs_to :target, polymorphic: true

# Serialize parameters Hash
# :nocov:
if Rails.gem_version >= Gem::Version.new('7.1')
serialize :optional_targets, type: Hash, coder: YAML
else
serialize :optional_targets, Hash
end
# :nocov:

validates :target, presence: true
validates :key, presence: true, uniqueness: { scope: :target }
Expand Down

0 comments on commit 3f47fab

Please sign in to comment.