app/jobs/send_db_diff_job.rb
# Save the DB-editing SQL text and deliver it to the Admin for remote storage.
#
Save the DB-editing SQL text and deliver it to the Admin for remote storage.
Save the DB - editing SQL text and deliver it to the Admin for remote storage .
def prepare_and_deliver_db_diff_file()
    logger.info("Saving DB-diff text...")
    output_dir = File.join( Rails.root, 'public', 'output' )
    file_name  = "#{ DateTime.now().strftime('%Y%m%d%H%M') }#{ Rails.env == 'production' ? 'dev' : 'prod' }_remote_edit.diff.sql"
    full_diff_pathname  = File.join( output_dir, file_name )
    base_filename       = File.basename( full_diff_pathname )
    save_diff_file( full_diff_pathname )
    logger.info( "DB-diff file '#{ base_filename }' created." )
    logger.info( "Sending file..." )
    AgexMailer.action_notify_mail(
      nil, 
       "Collected DB-diff",
      "Remote edit multi-action DB-diff file.\r\nThe attached log file must be saved & synchronized by a local Admin app instance.",
      base_filename,
      full_diff_pathname
    ).deliver
  end
def prepare_and_deliver_db_diff_file ( ) logger . info ( "Saving DB-diff text..." ) output_dir = File . join ( Rails . root , 'public' , 'output' ) file_name = "#{ DateTime.now().strftime('%Y%m%d%H%M') }#{ Rails.env == 'production' ? 'dev' : 'prod' }_remote_edit.diff.sql" full_diff_pathname = File . join ( output_dir , file_name ) base_filename = File . basename ( full_diff_pathname ) save_diff_file ( full_diff_pathname ) logger . info ( "DB-diff file '#{ base_filename }' created." ) logger . info ( "Sending file..." ) AgexMailer . action_notify_mail ( nil , "Collected DB-diff" , "Remote edit multi-action DB-diff file.\r\nThe attached log file must be saved & synchronized by a local Admin app instance." , base_filename , full_diff_pathname ) . deliver end
Save the DB-editing SQL text and deliver it to the Admin for remote storage.
Save the DB - editing SQL text and deliver it to the Admin for remote storage .
# Save the text into a file & send it (but only in production mode) # Send the DB diff file to the SysOp # (no current_user)