-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
alias_method "old_#{attribute}=", "#{attribute}="
define_method "#{attribute}=" do |value|
normalized_value = self.send(:"normalize_#{attribute}", value)
self.send("old_#{attribute}=", normalized_value)
endold_ is not a good naming scheme.
Better use something like attribute_without_attribute_normalizer and attribute_with_attribute_normalizer
Some resources showing this naming convention: