ruby on rails - Is it bad practice for scripts to write over parts of themslves? -
i writing script (a rails runner, if matters) run periodically. uses gem query sql database. because database not update existing rows, merely adds new ones reflect changes data, script run query finds objects id greater id in database last time script run.
in file should id stored? bad practice store in script , have script write on itself, , if so, why?
store id in separate file. not script writing on more difficult correctly, practice confuse users, , result in whole host of other problems, such additional friction when trying version control script or update new version.
under circumstances, data , code should separate.
Comments
Post a Comment