Better decide if journal implements the method itself. #554
This commit is contained in:
parent
8eb72a3c74
commit
af50984023
|
@ -108,7 +108,7 @@ class Journal < ActiveRecord::Base
|
||||||
## => Try the journaled object with the same method and arguments
|
## => Try the journaled object with the same method and arguments
|
||||||
## => On error, call super
|
## => On error, call super
|
||||||
def method_missing(method, *args, &block)
|
def method_missing(method, *args, &block)
|
||||||
return super if attributes[method.to_s]
|
return super if respond_to?(method) || attributes[method.to_s]
|
||||||
journaled.send(method, *args, &block)
|
journaled.send(method, *args, &block)
|
||||||
rescue NoMethodError => e
|
rescue NoMethodError => e
|
||||||
e.name == method ? super : raise(e)
|
e.name == method ? super : raise(e)
|
||||||
|
|
Loading…
Reference in New Issue