Class: ActiveModel::DeprecationHandlingMessageArray
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
Instance Method Summary
Constructor Details
.new(content, errors, attribute) ⇒ DeprecationHandlingMessageArray
# File 'activemodel/lib/active_model/errors.rb', line 639
def initialize(content, errors, attribute) @errors = errors @attribute = attribute super(content.freeze) end
Instance Method Details
#<<(message)
[ GitHub ]# File 'activemodel/lib/active_model/errors.rb', line 645
def <<( ) ActiveSupport::Deprecation.warn("Calling `<<` to an ActiveModel::Errors message array in order to add an error is deprecated. Please call `ActiveModel::Errors#add` instead.") @errors.add(@attribute, ) __setobj__ @errors. (@attribute) self end
#clear
[ GitHub ]# File 'activemodel/lib/active_model/errors.rb', line 653
def clear ActiveSupport::Deprecation.warn("Calling `clear` to an ActiveModel::Errors message array in order to delete all errors is deprecated. Please call `ActiveModel::Errors#delete` instead.") @errors.delete(@attribute) end