Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Artem Pecherin's Profile

GitHub User: apecherin

Comments by Artem Pecherin


Please any idea of use delayed_jobs for multitenant app with Postgresql schemas.
Each task puts in current schema to the moment. But DJ getting tasks from public schema only.


You can try use uniq name of uploaded files-

def filename
    random_token = Digest::SHA2.hexdigest("#{}--#{}").first(40)
    ivar = "@#{mounted_as}_secure_token"
    token = model.instance_variable_get(ivar)
    token ||= model.instance_variable_set(ivar, random_token)
    "#{token}.#{file.extension}" if original_filename