Displaying 2 results from an estimated 2 matches for "find_with_old".
2006 May 11
0
acts_as_paranoid, aliasing and nested scopes in Rails 1.1
...weenie.net/projects/plugins/acts_as_paranoid/lib/caboose/acts/paranoid.rb):
#--------------------------------------------------------------BEGIN
module VeryNew
#...
module ClassMethods
def acts_as_very_new
unless is_very_new?
class << self
alias_method :find_with_old, :find
end
end
include InstanceMethods
end
#...
end
module InstanceMethods #:nodoc:
#...
module ClassMethods
def find(*args)
with_very_new_scope { find_with_old(*args) }
end
protected
def with_very_new_scope...
2006 May 11
1
acts_as_paranoid and nested scopes in Rails 1.1
...or testing), and just
simplified the code:
#--------------------------------------------------------------
module VeryNew
#...
module ClassMethods
def acts_as_very_new
unless is_very_new? # don''t let AR call this twice
class << self
alias_method :find_with_old, :find
end
end
include InstanceMethods
end
# end
module InstanceMethods #:nodoc:
def self.included(base) # :nodoc:
base.extend ClassMethods
end
module ClassMethods
def find(*args)
with_very_new_scope { find_with_old(*args) }...