diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-08-01 19:43:59 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-08-05 08:18:39 -0300 |
commit | 28f6b895c6eccd4347eb636c99ec4d54a026cabe (patch) | |
tree | 936b67152de3c648265e8844ad2fc1375fdab082 | |
parent | 3300fdedc748993b378288c6cbc3113885c955ed (diff) | |
download | rails-28f6b895c6eccd4347eb636c99ec4d54a026cabe.tar.gz rails-28f6b895c6eccd4347eb636c99ec4d54a026cabe.tar.bz2 rails-28f6b895c6eccd4347eb636c99ec4d54a026cabe.zip |
Call public methods rather than class_eval'ing
-rw-r--r-- | activemodel/lib/active_model/naming.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb index 86f5c96af9..241e88deeb 100644 --- a/activemodel/lib/active_model/naming.rb +++ b/activemodel/lib/active_model/naming.rb @@ -215,10 +215,8 @@ module ActiveModel # provided method below, or rolling your own is required. module Naming def self.extended(base) #:nodoc: - base.class_eval do - remove_possible_method(:model_name) - delegate :model_name, to: :class - end + base.remove_possible_method :model_name + base.delegate :model_name, to: :class end # Returns an ActiveModel::Name object for module. It can be |