module ActiveModel::AttributeAssignment

def attribute_writer_missing(name, value)

rectangle.assign_attributes(height: 10) # => Logs "Tried to assign to unknown attribute 'height'"
rectangle = Rectangle.new

end
end
Rails.logger.warn "Tried to assign to unknown attribute #{name}"
def attribute_writer_missing(name, value)

attr_accessor :length, :width

include ActiveModel::AttributeAssignment
class Rectangle

By default, `#attribute_writer_missing` raises an UnknownAttributeError.

when `#assign_attributes` is passed an unknown attribute name.
Like `BasicObject#method_missing`, `#attribute_writer_missing` is invoked
def attribute_writer_missing(name, value)
  raise UnknownAttributeError.new(self, name)
end