DEPRECATION WARNING: Dangerous query method: Random Record in ActiveRecord >= 5.2

If you want to continue using order by random() then just declare it safe by wrapping it in Arel.sql like the deprecation warning suggests: Model.order(Arel.sql(‘random()’)).first # PostgreSQL Model.order(Arel.sql(‘rand()’)).first # MySQL There are lots of ways of selecting a random row and they all have advantages and disadvantages but there are times when you absolutely must … Read more

Deprecation warning when installing nodejs on docker container using nodesource install script

The notice from the script is This script, located at https://deb.nodesource.com/setup_X, used to install Node.js is deprecated now and will eventually be made inactive. Please visit the NodeSource distributions Github and follow the instructions to migrate your repo. https://github.com/nodesource/distributions The NodeSource Node.js Linux distributions GitHub repository contains information about which versions of Node.js and which … Read more

variantOutput.getPackageApplication() is obsolete

variantOutput.getPackageApplication() is being caused by a changed variant API. changing output.outputFile.parent to variant.getPackageApplicationProvider().get().outputs.files[1] is at least a temporary workaround. source: @Selvin. variant.getExternalNativeBuildTasks() is being caused by the io.fabric plugin. the next version of the io.fabric plugin will use variant.getExternalNativeBuildProviders(). source: 116408637; the confirmation for a promised fix (1.28.1). These are caused by com.google.gms.google-services: registerResGeneratingTask is … Read more

Gradle warning: variant.getOutputFile() and variant.setOutputFile() are deprecated

Building on the answer from Larry Schiefer you can change the script to something like this: android { applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith(‘.apk’)) { def fileName = outputFile.name.replace(‘.apk’, “-${versionName}.apk”) output.outputFile = new File(outputFile.parent, fileName) } } } }

getSerializableExtra and getParcelableExtra are deprecated. What is the alternative?

This is what I use: inline fun <reified T : Serializable> Bundle.serializable(key: String): T? = when { Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> getSerializable(key, T::class.java) else -> @Suppress(“DEPRECATION”) getSerializable(key) as? T } inline fun <reified T : Serializable> Intent.serializable(key: String): T? = when { Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> getSerializableExtra(key, T::class.java) else -> @Suppress(“DEPRECATION”) getSerializableExtra(key) as? T } … Read more

DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7

mongoose.set(“strictQuery”, false); mongoose.connect(process.env.MONGO_URL); OR mongoose.set(“strictQuery”, false); mongoose.connect(process.env.MONGO_URL, () => { console.log(“Connected to MongoDB”); }); const connectDB = async () => { try { mongoose.set(‘strictQuery’, false); await mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true, }); console.log(‘MongoDB Connected…’); } catch (err) { console.error(err.message); // make the process fail process.exit(1); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)