search for: find_active

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

2007 Oct 18
9
with_scope issue
I have the following code: class User < ActiveRecord::Base has_many :requests do def find_active(options = {}) with_scope :find => { :conditions => ["requests.active = ?", true] } do find(:all, options) end end end end Executing user.requests.find_active results in the following SQL: SELECT * FROM requests WHERE (( requests.user_id = 10 ) AND ( requests...
2008 Mar 18
1
Polling is REALLY slow
...PollerWorker < BackgrounDRb::MetaWorker set_worker_name :request_queue_poller_worker QUEUE_SLEEP_TIME = 30 # seconds def create(args = nil) @running = true self.poll_queue end def build_all_matches(args = nil) thread_pool.defer(args) do |args| requests = Request.find_active(:all) requests.each { |request| request.queue! } # using acts_as_state_machine end end protected # Was hoping to get multiple threads processing def build_matches(args = nil) thread_pool.defer(args) do |args| request = Request.find(args.to_i) request.build_ma...
2016 Mar 23
7
[PATCH v4 0/6] tests/qemu: Add program for tracing and analyzing boot times.
v4: - Lots more analysis of the /init script and other parts. - Display a list of the longest to shortest activities. - Rebase on top of current head. Rich.
2016 Mar 19
1
[PATCH] tests/qemu: Add program for tracing and analyzing boot times.
--- .gitignore | 1 + tests/qemu/Makefile.am | 22 +- tests/qemu/boot-analysis.c | 1098 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1118 insertions(+), 3 deletions(-) create mode 100644 tests/qemu/boot-analysis.c diff --git a/.gitignore b/.gitignore index 1493011..9306a19 100644 --- a/.gitignore +++ b/.gitignore @@ -510,6 +510,7 @@ Makefile.in
2005 Dec 26
0
Extend the find-method: more conditions
Hi, I want to share some helpful code snippet. Can it further be optimized? Or is this even good to do? Put this in your model to write a customized find method having more conditions: def self.find_active(*args) options = extract_options_from_args!(args) conditions = "AND (#{sanitize_sql(options[:conditions])})" if options[:conditions] options[:conditions] = "ADDITIONAL_CONDITIONS_GO_HERE #{conditions}" args << options find(*args) end regards,...
2008 Mar 04
9
What is your workflow? Or how to use the story runner the right way.
I really would like to know how people are using the Story and Example runner to write their software.It would be great to get some direction on it, because I think I''m missing some points. Taking the outside-in approach in thought: At first we write a high-level customer-facing story, this story fails. Then we start using mocks at object level to use them as a design tool, and so we
2016 Mar 22
19
[PATCH v3 0/11] tests/qemu: Add program for tracing and analyzing boot times.
Lots of changes since v2, too much to remember or summarize. Please ignore patch 11/11, it's just for my testing. Rich.
2016 Mar 20
14
[PATCH v2 0/7] tests/qemu: Add program for tracing and analyzing boot times.
v1 was here: https://www.redhat.com/archives/libguestfs/2016-March/thread.html#00157 Not running the 'hwclock' command reduces boot times considerably. However I'm not sure if it is safe. See the question I posted on qemu-devel: http://thread.gmane.org/gmane.comp.emulators.qemu/402194 At the moment, about 50% of the time is consumed by SeaBIOS. Of this, about ⅓rd is SGABIOS