Sha256: 721b655c16e0b54221489e015f0cde83e9e48ce57b6934c55d8da7e6ee225f80
Contents?: true
Size: 889 Bytes
Versions: 9
Compression:
Stored size: 889 Bytes
Contents
# == Schema Information # # Table name: customers # # id :integer not null, primary key # full_name :string # email :string # created_at :datetime not null # updated_at :datetime not null # class Customer < ApplicationRecord include PubSubModelSync::SubscriberConcern ps_subscribe(%i[create update destroy], %i[name:full_name email], id: :id, from_klass: 'User') ps_subscribe(:send_email, [], from_klass: 'User') # instance subscription ps_class_subscribe(:send_emails, from_klass: 'User') # class subscription after_create { log "User created: #{inspect}" } after_update { log "User updated: #{inspect}" } after_destroy { log "User Destroyed: #{inspect}" } def self.send_emails(data) log("Sending emails to many users: #{data.inspect}") end def send_email(data) log("Sending email to: #{data.inspect}") end end
Version data entries
9 entries across 9 versions & 1 rubygems