I require different behavior from ActiveRecord::AttributeAssignment.assign_attributes(new_attributes, options).
For my entire web application, I want to evaluate [and frequently overwrite] new_attributes. (I want to do this to support third party UI widgets which do not follow rails form naming conventions). Although this might be a bit stinky, I can write the patch to only activate if the call did come from the third party form.
I have written a patch and can override the normal behavior; however, I’m wondering if it is possible to call the original method from within my patch?
Of course I can just cut and paste the original assign_attributes into my patch. Is there a better way?
alias_method_chainexists for this exact situation.It’s not always the right choice, but works well when you have a fitting use case, which this one looks to be.