Better decide if journal implements the method itself. #554

This commit is contained in:
Felix Schäfer 2011-11-06 13:25:14 +01:00 committed by Felix Schäfer
parent 8eb72a3c74
commit af50984023
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class Journal < ActiveRecord::Base
## => Try the journaled object with the same method and arguments
## => On error, call super
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)
rescue NoMethodError => e
e.name == method ? super : raise(e)