Class: ActiveModel::DeprecationHandlingMessageHash
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
SimpleDelegator
|
|
Instance Chain:
self,
SimpleDelegator
|
|
Inherits: |
SimpleDelegator
|
Defined in: | activemodel/lib/active_model/errors.rb |
Class Method Summary
- .new(errors) ⇒ DeprecationHandlingMessageHash constructor
Instance Method Summary
Constructor Details
.new(errors) ⇒ DeprecationHandlingMessageHash
# File 'activemodel/lib/active_model/errors.rb', line 600
def initialize(errors) @errors = errors super(prepare_content) end
Instance Method Details
#[]=(attribute, value)
[ GitHub ]# File 'activemodel/lib/active_model/errors.rb', line 605
def []=(attribute, value) ActiveSupport::Deprecation.warn("Calling `[]=` to an ActiveModel::Errors is deprecated. Please call `ActiveModel::Errors#add` instead.") @errors.delete(attribute) Array(value).each do || @errors.add(attribute, ) end __setobj__ prepare_content end
#delete(attribute)
[ GitHub ]# File 'activemodel/lib/active_model/errors.rb', line 616
def delete(attribute) ActiveSupport::Deprecation.warn("Calling `delete` to an ActiveModel::Errors messages hash is deprecated. Please call `ActiveModel::Errors#delete` instead.") @errors.delete(attribute) end