lib/acts_as_versioned.rb
# Executes the block with the versioning callbacks disabled.
#
#   Foo.without_revision do
#     @foo.save
#   end
#
Executes the block with the versioning callbacks disabled.
Executes the block with the versioning callbacks disabled .
def without_revision(&block)
            class_eval do 
              CALLBACKS.each do |attr_name|
                alias_method "orig_#{attr_name}".to_sym, attr_name
                alias_method attr_name, :empty_callback
              end
            end
            block.call
          ensure
            class_eval do 
              CALLBACKS.each do |attr_name|
                alias_method attr_name, "orig_#{attr_name}".to_sym
              end
            end
          end
def without_revision ( & block ) class_eval do CALLBACKS . each do | attr_name | alias_method "orig_#{attr_name}" . to_sym , attr_name alias_method attr_name , :empty_callback end end block . call ensure class_eval do CALLBACKS . each do | attr_name | alias_method attr_name , "orig_#{attr_name}" . to_sym end end end
Executes the block with the versioning callbacks disabled.
Executes the block with the versioning callbacks disabled .
block