TheOdinProject / theodinproject

Main Website for The Odin Project
http://www.theodinproject.com
MIT License
3.55k stars 2.06k forks source link

Upgrade: Bump noticed from 1.6.3 to 2.3.1 #4543

Closed dependabot[bot] closed 1 month ago

dependabot[bot] commented 1 month ago

Bumps noticed from 1.6.3 to 2.3.1.

Release notes

Sourced from noticed's releases.

v2.3.1

Full Changelog: https://github.com/excid3/noticed/compare/v2.3.0...v2.3.1

v2.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/excid3/noticed/compare/v2.2.2...v2.3.0

v2.2.2

Full Changelog: https://github.com/excid3/noticed/compare/v2.2.1...v2.2.2

v2.2.1

What's Changed

  • Support procs and symbol method calls with fetch_constant helpers
  • Use 'attributes[:params]' instead of 'params' in the example about migrating associated records in UPGRADE.md by @​drjole in excid3/noticed#427

New Contributors

Full Changelog: https://github.com/excid3/noticed/compare/v2.2.0...v2.2.1

v2.2.0

What's Changed

... (truncated)

Changelog

Sourced from noticed's changelog.

2.3.1

  • Skip ApplicationNotifier in generator if it already exists

2.3.0

  • Add error_handler to Twilio delivery method #444
  • Fix record being removed for Ephemeral notifications #448

2.2.2

  • fetch_constant will now constantize Strings returned from procs or method calls

2.2.1

  • fetch_constant used by Email and ActionCable delivery methods now support procs and method calls with symbols like other options

2.2.0

  • Add config.before_enqueue callback This callback can be used to skip enqueuing delivery methods:
class CommentNotifier < Noticed::Event
  deliver_by :email do |config|
    config.before_enqueue = ->{ throw(:abort) unless recipient.email_notifications? }
  end
end
  • Fix iOS format option with Symbols. This now passes the notification and apn objects instead of just the apn.
config.format = :ios_format

...

def ios_format(notification, apn) end

  • Re-add deserialize_error? to Noticed::Event

2.1.3

  • Stringify keys for Twilio Messaging json

2.1.2

  • Fix counter cache migration version for older Rails

... (truncated)

Upgrade guide

Sourced from noticed's upgrade guide.

Noticed Upgrade Guide

Follow this guide to upgrade your Noticed implementation to the next version

Noticed 2.1

We've added a counter cache to Noticed::Event to keep track of the associated notifications.

Run the following command to copy over the migrations:

rails noticed:install:migrations

Noticed 2.0

We've made some major changes to Noticed to simplify and support more delivery methods.

Models

Instead of having models live in your application, Noticed v2 adds models managed by the gem.

Delete the Notification model at app/models/notification.rb.

Then run the new migrations:

rails noticed:install:migrations
rails db:migrate

To migrate your data to the new tables, loop through your existing notifications and create new records for each one. You can do this in a Rake task or in the Rails console:

# Temporarily define the Notification model to access the old table
class Notification < ActiveRecord::Base
  self.inheritance_column = nil
end

Migrate each record to the new tables

Notification.find_each do |notification| attributes = notification.attributes.slice("type", "created_at", "updated_at").with_indifferent_access attributes[:type] = attributes[:type].sub("Notification", "Notifier") attributes[:params] = Noticed::Coder.load(notification.params) attributes[:params] = {} if attributes[:params].try(:has_key?, "noticed_error") # Skip invalid records

Extract related record to belongs_to :record association

This allows ActiveRecord associations instead of querying the JSON data

attributes[:record] = attributes[:params].delete(:user) || attributes[:params].delete(:account)

attributes[:notifications_attributes] = [{ type: "#{attributes[:type]}::Notification", </tr></table>

... (truncated)

Commits
  • f52e870 Version bump
  • bc93b64 Skip application notifier if it already exists
  • 5a1fb91 Use matching sqlite3 versions for Rails versions
  • 8e2dc61 Merge branch 'main' of github.com:excid3/noticed
  • 68c406f Version bump
  • 7cb10d1 Update twilio_messaging.md
  • 2ef3c18 Twilio delivery method allows Notifier to handle errors (#444)
  • 2a3dbb0 Don't remove record from params with ephemeral notifications (#448)
  • 923d390 Update fcm.md (#449)
  • 0db2b83 Fix evaluate_option example (#447)
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
dependabot[bot] commented 1 month ago

Superseded by #4545.