Forum: Ruby on Rails how to disable callback

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Iphan I. (Guest)
on 2006-05-31 16:55
How do I locally disable a callback from being performed?

My class has

class Keyword < ActiveRecord::Base

after_update :switch_versioned

      # Callback used to warn the user that an updated record
      # has not been saved in the version table
      def switch_versioned
        logger.debug "coucou"
        self.versioned= false

But another class has a method that sets

@keyword.versioned= true

so in this case I want to disable the callback... there is probably a
better way to do it?

any help appreciated

This topic is locked and can not be replied to.