Namespace Extlib versions of class_inheritable_accessor methods with extlib_prefix, as done in Wycats' Rails fork, so that their inclusion won't overwrite existing ActiveSupport implementations, if present. Check for existence of Class extensions on a per-method basis.
This commit is contained in:
parent
de0476b083
commit
a1a4985149
5 changed files with 148 additions and 222 deletions
|
@ -426,10 +426,10 @@ module CouchRest
|
|||
def define_callbacks(*symbols)
|
||||
terminator = symbols.pop if symbols.last.is_a?(String)
|
||||
symbols.each do |symbol|
|
||||
self.class_inheritable_accessor("_#{symbol}_terminator")
|
||||
self.extlib_inheritable_accessor("_#{symbol}_terminator")
|
||||
self.send("_#{symbol}_terminator=", terminator)
|
||||
self.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
||||
class_inheritable_accessor :_#{symbol}_callbacks
|
||||
extlib_inheritable_accessor :_#{symbol}_callbacks
|
||||
self._#{symbol}_callbacks = CallbackChain.new(:#{symbol})
|
||||
|
||||
def self.#{symbol}_callback(*filters, &blk)
|
||||
|
@ -480,4 +480,4 @@ module CouchRest
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue