search for: other_method

Displaying 8 results from an estimated 8 matches for "other_method".

2006 Feb 15
2
extending rails via /lib - problems
...seemed to be the only way. Alright... so I have something like this: /lib/code.rb class ActiveRecord::Base def method_a(n) ....... end def method_b(n) ........ end end /models/some_model.rb class SomeModel < ActiveRecord::Base def self.some_method(a, b) ........ end def other_method ........ end end I also added `require ''code''` to enviroment.rb My problem is that, for some reason, I can''t use any method declared in code.rb inside `self.some_method`. However, the methods work perfectly well inside `other_method`. I have to include all the cod...
2007 May 26
0
New worker not being created
...ple worker: > > class ExampleWorker < BackgrounDRb::Worker::RailsBase > > def do_work(args) > logger.info(''ExampleWorker do work'') > results[:do_work_time] = Time.now.to_s > results[:done_with_do_work] ||= true > end > > def other_method > logger.info(''other_method in ExampleWorker called'') > results[:extra_data] = "Just a plain old string" > end > > end > ExampleWorker.register > > Then in a controller, I have: > > def test_backgroundrb > key = Middle...
2007 May 09
0
Neophyte needs help!
...################################################################# class ExampleWorker < BackgrounDRb::Worker::RailsBase def do_work(args) logger.info(''ExampleWorker do work'') results[:do_work_time] = Time.now.to_s results[:done_with_do_work] ||= true end def other_method logger.info(''other_method in ExampleWorker called'') results[:extra_data] = "Just a plain old string" end def arg_method(arg) end end ExampleWorker.register ##################################################################### Next, I created a ''...
2007 Jun 25
3
one more "uninitialized constant" problem
...e_with_do_work] || = true end end And this is the code that I have in RAILS_ROOT/app/controllers/mytest2_controller.rb class Mytest2Controller < ApplicationController def new key = MiddleMan.new_worker(:class => :testing_worker) worker = MiddleMan.worker(key) #worker.other_method #worker.delete end end And this is what I get when I access: http://host:3000/mytest2/new NameError in Mytest2Controller#new uninitialized constant TestingWorker RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace I don''t understand wh...
2007 Mar 02
1
example standalone error.
...bject.init(:uri =>''drbunix:///tmp/backgroundrbunix_localhost_2000'') require ''backgroundrb/middleman'' include BackgrounDRb puts ''my sample app :)'' key = MiddleMan.new_worker(:class => :example_worker) worker = MiddleMan.worker(key) worker.other_method worker.delete # now that my job is done (and my worker is actually deleted on the server) view # my results ... cause now I''lm interested. p worker.results.to_hash puts ''bye bye :)'' I kinda confused because most of the examples online and in /examples assume that one is...
2011 Dec 02
1
How to implement ActionMailer callbacks for rails3?
Hi, Is it possible to implement callbacks(like before_deliver :some_methodes, after_deliver :other_methods) with ActionMailer in Rails3? Please somebody help me or give me an idea :) Already I saw http://railscasts.com/episodes/206-action-mailer-in-rails-3 but it I like to do it as callbacks -- Best Regards Abdul Barek Senior Software Engineer -- You received this message because you are subscribed...
2006 Oct 30
11
BackgrounDRb 0.2.0 Release! Complete rewrite.
...built in ''trigger'' types. A simple ''trigger'' is specified with start, stop and interval: require ''active_support'' MiddleMan.schedule_worker( :class => :example_worker, :job_key => :schedule_test, :worker_method => :other_method, :trigger_args => { :start => Time.now + 5.seconds, :end => Time.now + 10.minutes, :repeat_interval => 30.seconds } The cron trigger uses a similar syntax to cron found on UNIX systems: MiddleMan.schedule_worker( :class => simple_class, :...
2006 Oct 30
1
new BackgroundRB
...#39;trigger'' is specified with start, stop and interval: > > > > require ''active_support'' > > MiddleMan.schedule_worker( > > :class => :example_worker, > > :job_key => :schedule_test, > > :worker_method => :other_method, > > :trigger_args => { > > :start => Time.now + 5.seconds, > > :end => Time.now + 10.minutes, > > :repeat_interval => 30.seconds > > } > > > > The cron trigger uses a similar syntax to cron found on UNIX systems:...