I need to run a method once daily in a Rails application.
I'm thinking about using the whenever gem, but I realize I have a bit of a problem.
I need to run the method on an instance of an object. So I can't just have something like:
every 1.day do
runner 'Object.method'
end
I'm thinking about doing something like
every 1.day do
runner 'Object.where(status: "the_status_i_want").each { |object| object.method }'
end
But I have no clue how to test this behavior from within 'whenever.'
Any ideas?