Skip to content
Snippets Groups Projects
Select Git revision
  • 610f355f64a87b8cc8af8a3ca33e5d37c4e82c70
  • main default protected
  • renovate/solid_queue-1.x-lockfile
  • renovate/selenium-webdriver-4.x-lockfile
  • renovate/icalendar-2.x-lockfile
  • renovate/debug-1.x-lockfile
  • renovate/turbo-rails-2.x-lockfile
  • renovate/gcr.io-kaniko-project-executor-1.x
  • renovate/ruby
  • eh22 protected
  • update-rubocop
11 results

speaker.rb

Blame
  • speaker.rb 499 B
    class Speaker < ApplicationRecord
      belongs_to :conference
      has_many :session_speakers, dependent: :destroy
      has_many :sessions, through: :session_speakers
    
      validates :ref_id, uniqueness: { scope: :conference_id }
    
      after_update :notify_if_changed
    
      def to_param
        ref_id
      end
    
      private
    
      def notify_if_changed
        return if new_record?
        if saved_changes.present?
          ActiveSupport::Notifications.instrument("speaker.updated", record: self, changes: saved_changes)
        end
      end
    end