lib/config_scripts/scripts/script.rb
# This method runs the script in a given direction.
#
# This will use either the +up+ or +down+ method. That method call will be
# wrapped in a transaction, so if the script raises an exception, all of
# its changes will be rolled back.
#
# If the method runs successfully, this will either record a timestamp
# or remove a timestamp in the +config_scripts+ table.
#
# @param [Symbol] direction
#   Whether we should run +up+ or +down+.
This method runs the script in a given direction.
This will use either the +up+ or +down+ method. That method call will be
wrapped in a transaction, so if the script raises an exception, all of
its changes will be rolled back.

If the method runs successfully, this will either record a timestamp
or remove a timestamp in the +config_scripts+ table.
This method runs the script in a given direction . This will use either the + up + or + down + method . That method call will be wrapped in a transaction so if the script raises an exception all of its changes will be rolled back . If the method runs successfully this will either record a timestamp or remove a timestamp in the + config_scripts + table .
def run(direction)
        ActiveRecord::Base.transaction do
          begin
            self.send(direction)
          rescue => e
            puts "Error running script for #{self.class.name}: #{e.message}"
            puts e.backtrace.first
            raise e
          end
          case(direction)
          when :up
            ScriptHistory.record_timestamp(@timestamp)
          when :down
            ScriptHistory.remove_timestamp(@timestamp)
          end
        end
      end
def run ( direction ) ActiveRecord :: Base . transaction do begin self . send ( direction ) rescue => e puts "Error running script for #{self.class.name}: #{e.message}" puts e . backtrace . first raise e end case ( direction ) when :up ScriptHistory . record_timestamp ( @timestamp ) when :down ScriptHistory . remove_timestamp ( @timestamp ) end end end
This method runs the script in a given direction.
This method runs the script in a given direction .
direction
<not_specific>
<not_specific>
direction Whether we should run +up+ or +down+.
direction Whether we should run + up + or + down + .