Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better naming for old_#{attribute} #65

Open
tmaier opened this issue Jul 28, 2014 · 1 comment
Open

Better naming for old_#{attribute} #65

tmaier opened this issue Jul 28, 2014 · 1 comment
Labels
Milestone

Comments

@tmaier
Copy link
Contributor

tmaier commented Jul 28, 2014

https://github.com/mdeering/attribute_normalizer/blob/master/lib/attribute_normalizer/model_inclusions.rb#L51-L57

          alias_method "old_#{attribute}=", "#{attribute}="

          define_method "#{attribute}=" do |value|
            normalized_value = self.send(:"normalize_#{attribute}", value)
            self.send("old_#{attribute}=", normalized_value)
          end

old_ 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:

@mdeering
Copy link
Owner

Agree with this. Would gladly accept a pull request making these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants