开发者

rails 3 access to model and mailer from external script

开发者 https://www.devze.com 2023-02-18 14:09 出处:网络
As in topic how i can access model and mailer from ruby script? I want to do some thinks which are not web related and can\'t be done via rails but are bound to databa开发者_如何学Pythonse used in rai

As in topic how i can access model and mailer from ruby script? I want to do some thinks which are not web related and can't be done via rails but are bound to databa开发者_如何学Pythonse used in rails. For eg. i want to check when sb premium ends and 7 days before sand him email. Best regards


Set up a rake task which you can call and check the output of.

In lib/tasks/appname.rake

task :do_some_stuff => :environment do
  # any code you want in here.
  puts "some output"
end

You can then call it from the command line with

rake do_some_stuff
0

精彩评论

暂无评论...
验证码 换一张
取 消