Displaying 1 result from an estimated 1 matches for "kill_wacko".
Did you mean:
kill_wackos
2008 Mar 07
6
creating a model registry
...all,
This is a problem I''ve approached so many times and always worked
around, that now I want to solve it once and for all. Say I have
something like this:
---
class X < ActiveRecord::Base
acts_as_wacky
end
module Wackinator
class ControlAllWackos
@@wackos = []
def self.kill_wackos
@@wackos.each(&:kill)
end
end
def acts_as_wacky
ControlAllWackos.wackos << self
# do stuff
end
end
---
I know that code won''t actually run, but hopefully it serves to
illustrate my point.
Which is that since Rails loads models with load_missing_constan...