Skip to content

Instantly share code, notes, and snippets.

@jordanbrock
Last active August 7, 2020 02:02
Show Gist options
  • Save jordanbrock/b6fd00c727a2d6a33366554a57e5a7b1 to your computer and use it in GitHub Desktop.
Save jordanbrock/b6fd00c727a2d6a33366554a57e5a7b1 to your computer and use it in GitHub Desktop.
Params deserialisation issue
# Represents a selection of a Player for a Match
class Selection < ApplicationRecord
acts_as_list scope: :match
belongs_to :match
belongs_to :player
# Ensure that the selections are returned in postition order
def self.default_scope
order(position: :asc)
end
end
# To deliver this notification
#
# SelectionNotification.with(post: @post).deliver_later(current_user)
# SelectionNotification.with(post: @post).deliver(current_user)
class SelectionNotification < Noticed::Base
# Add your delivery methods
#
deliver_by :database
# deliver_by :email, mailer: "UserMailer"
# deliver_by :slack
# deliver_by :custom, class: "MyDeliveryMethod"
# Add required params
#
param :selection
# Define helper methods to make rendering easier.
#
# def message
# t(".message")
# end
#
# def url
# post_path(params[:post])
# end
end
@jordanbrock
Copy link
Author

Awesome stuff Chris. Trying it out now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment