• T
    Trust `Object#dup` in `ActionController::Parameters`, using `#initialize_copy`... · 96070595
    Tim Rogers 提交于
    Trust `Object#dup` in `ActionController::Parameters`, using `#initialize_copy` to manually duplicate the underlying parameters hash
    
    It looks like `ActionController::Parameters#dup` is leftover from when the class inherited from `Hash`. We can just trust `#dup`, which already copies the `@permitted` instance variable (confirmed by tests). We still define a `#initialize_copy` to make `@parameters` a copy that can be mutated without affecting the original instance.
    96070595
strong_parameters.rb 31.0 KB