ruby on rails - Whenever Plugin Help -
I'm trying to use the plugin to a process model at a time when rail My schedule .rb is as follows:
every 1.day, at => '5:30 am' runner "user.mail_out" end
My model is as follows:
class user & lt; ActiveRecord :: Base works_as_authentic DEF mail_out working days = Date.today.strftime ('% A') @users downcase = find. (: Status = & gt; "# {working days} sub = T") @ users.each {| You UserMailer.deliver_mail_out (U)} end end
command when I try script / runner -e development run "User.mail_out", I get the following error:
/var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48: undefined method `# & lt mail_out '; Class: 0xb708bd50 & gt; (Eval) from (NoMethodError): 1 from `eval '/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in from /var/lib/gems/1.8/gems/rails-2.3.5/lib `/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in from /commands/runner.rb:48 from gem_original_require '` /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in Script / Runner requires 3: 3
Can anyone explain what is going wrong?
Thank you!
You are getting this error Because you have defined example method example class method to correct it, to change method definition line ( self.
add):
def self.mail_out
To test this command line, something like this do:
script / runner "User.mail_out"
you might want to put the
or Print < / Code> Something happens to something that has happened to you.
Comments
Post a Comment