search for: magian

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

Did you mean: agian
2006 Jul 11
2
extending an active record model with obj.extend(Module)
Hi everyone, I am trying to extend an active record model using obj.extend(module). The aim is to overwrite some of the model methods depending on what''s in the object. For example, the base class would be "file", with objects such as "image", and "text". The aim is to be able to something like this: file = File.new() file.extend(Image) file.process
2006 Aug 15
5
Conditional extend of active record
Hi list, I''m trying to figure out the best way to add some functionality to active record. I have a table of files, and need to write a set of core functions that do different things depending on the type of file eg: class file < ActiveRecord::Base def resize ....does stuff end end the problem is the "....does stuff". For example, if the file is an image it
2006 Aug 03
6
create or update -
Hi everyone, I''m looking for a shortcut to finding and updating or creating record depending on the results of the find. So, is there a shorter way to do it than this? @stuff = Stuff.find_by_foo_and_bar("yay","hooray") if @stuff: Stuff.update(@stuff.id, {:foo => "boo", :bar => "hoo"}) else Stuff.create({:foo => "boo",
2006 Jul 20
1
self referential xml using builder
Hi listers, I''m trying to build an xml doc using Builder, but I''m having trouble getting it to draw a tree structure from a self-referential table. Here''s what I''m after: ========================== ---- object structure ---- node (name => root) - node (name => child 1) - node (name => child 2) - node (name => child 2.1) - node
2007 Feb 21
0
accessing controller methods from backgreoundrb
Hi all, I am trying to use backgroundrb to cache a set of controller actions that are quite processor expensive (there is some pretty heavy xml processing going on). In my rails app I have page caching set up to observe the appropriate controllers and models and all works well. However when model changes occur in a backgroundrb process the cache sweeper isn''t notified of the changes
2006 Jun 30
1
delay displaying rmagick resizing of uploaded images
Hi, I am using rmagick to resize a copy of uploaded images and display the copy as a thumbnail. Once the upload is processed it redirects the user to a page that should display the thumbnail to the user. The problem is that the rmagick resize function seems to keep going in the background after handing the new images url (and control) back to rails, which then happily renders the page with
2007 Jul 11
1
plugin not loading for model? (acts_as_ferret)
Hi all, I''m using the older win32 happy backgroundrb in combination with the ''acts_as_ferret'' install as a plugin. Since I''ve installed acts_as_ferret, I haven''t been able to get backgroundrb to start. It keeps failing at the ''acts_as_ferret'' method call in one of my models. Here''s a code snippet of the model: class Book
2006 Aug 25
1
backgroundrb fails when running as win32 service
Hi, I''ve been playing with backgroundrb to batch process a bunch of images on a rails server. The process is working fine when backgroundrb is started from the command line, but seems to choke occasionally (well, quite often) when running as a service. It seems to get stuck on the following line when moving files: FileUtils.move(src, dest, :verbose => true) with the error: Bad