In a RoR app, I want to specialize ActiveRecord\'s update_attributes() method in one of my models, extracting some of the attributes for special handling and passing the res
This looks like a better use for alias_method_chain:
def update_attributes_with_special(attrs)
attrs.each_pair do |key, val|
unless has_attribute?(key)
do_special_processing(key, val)
attrs.delete(key)
end
end
update_attributes_without_special(attrs)
end
alias_method_chain :update_attributes, :special