What is the proper way to replace/wrap functionality in ActiveRecord
for all my models? Currently, I am doing this which works:
alias write_attribute_internal write_attribute def write_attribute( attr_name, value ) value = nil if value == '' # Empty strings are considered nil! write_attribute_internal( attr_name, value ) end
But it feels messy. Inheritance seems to be out of the question
because of the way ActiveRecord infers the table name (table_name()).