I would like to perform several database queries and updates from a
rake task. All of the example code I have found on the web use
ActiveRecord to create a connection and generally perform ad-hoc sql
or use very low level ActiveRecord functionality. I haven’t found any
code that use model from the tasks. I have experimented using several
models in the rake tasks and it seems to work, except if any of the
models are using plugins.
Is it a bad practice to use models from rake tasks? If it is why? If
it isn’t what would be the best way to load the plugins?