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

Define additional methods for all attributes #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tonymarklove-babylon
Copy link

When defining multiple attributes in a single attr_encrypted definition, all of the attributes should have methods such as "#{attr}_changed?" and "#{attr}_was" defined.

Currently only the last attribute is popped from the array, and methods for all other attributes are not created.

For example:

attr_encrypted :name, :email

email_was # => defined
email_changed? # => defined

name_was # => not defined
name_changed? # => not defined

When defining multiple attributes in a single `attr_encrypted` definition, all of the attributes should have methods such as `"#{attr}_changed?"` and `"#{attr}_was"` defined.

Currently only the last attribute is popped from the array, and methods for all other attributes are not created.

For example:

```
attr_encrypted :name, :email

email_was # => defined
email_changed? # => defined

name_was # => not defined
name_changed? # => not defined
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant