diff options
Diffstat (limited to 'activemodel/lib/active_model/naming.rb')
| -rw-r--r-- | activemodel/lib/active_model/naming.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb index 5219de2606..86f5c96af9 100644 --- a/activemodel/lib/active_model/naming.rb +++ b/activemodel/lib/active_model/naming.rb @@ -214,6 +214,13 @@ module ActiveModel # is required to pass the Active Model Lint test. So either extending the # 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 + end + # Returns an ActiveModel::Name object for module. It can be # used to retrieve all kinds of naming-related information # (See ActiveModel::Name for more information). |
